【发布时间】:2012-10-16 01:01:31
【问题描述】:
我有一组按钮,当单击这些按钮时,页面上的说明会淡出,而所需的内容会淡入。div 还使用 jQuery .animate() 函数展开。当 div 完成扩展时,高度会跳变短。我做了一个 jsFiddle,但它在那里工作正常。所以,它一定与我的其他内容有关。
http://northviewhigh.com/index/fbla/1213/eb/styles.css - CSS 文件
[同上,不能发更多链接]/eb/jquery/scripts.js jQuery文件
这是代码:
<div id="tixcontainer">
<div class="tixinfo startinfo">
Select a ticket type to begin ordering your graduation tickets.
</div>
<div class="tixinfo hidden gradinfo">
You selected "Graduate"
</div>
</div>
#tixcontainer {
width:100%;
height:100px;
}
.tixinfo {
position:absolute;
top:629px;
}
.startinfo {
height:100px;
}
.gradinfo {
height:200px;
}
function expandTix(newHeight,cat) {
$('.startinfo').fadeOut();
$('#tixcontainer').animate({
height: newHeight
}, 'slow', function() {
$('.'+cat+'info').fadeIn();
});
}
$('.gradbutton').click(function() {
dimAllBut('grad');
expandTix(200,'grad');
});
【问题讨论】:
标签: jquery jquery-animate