jQuery高度动画在动画完成时跳转
我有一组按钮,当点击时,页面上的说明会淡出,所需的内容也会淡入。div还使用jQuery.animate()函数展开。当div完成扩展时,高度会变短。我做了一个JSFIDLE,但在那里效果很好。所以,它一定与我的其他内容有关 -CSS文件 [同上,不能发布更多链接]/eb/jquery/scripts.js jquery文件 下面是代码:jQuery高度动画在动画完成时跳转,jquery,jquery-animate,Jquery,Jquery Animate,我有一组按钮,当点击时,页面上的说明会淡出,所需的内容也会淡入。div还使用jQuery.animate()函数展开。当div完成扩展时,高度会变短。我做了一个JSFIDLE,但在那里效果很好。所以,它一定与我的其他内容有关 -CSS文件 [同上,不能发布更多链接]/eb/jquery/scripts.js jquery文件 下面是代码: <div id="tixcontainer"> <div class="tixinfo startinfo">
<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>
这看起来是同一个问题: 将
溢出:hidden
添加到示例页面上的#tixcontainer
,可以停止跳转
#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');
});