jQuery高度动画在动画完成时跳跃

标签 jquery jquery-animate

我有一组按钮,单击这些按钮时,页面上的说明会淡出,所需内容会淡入。div 还可以使用 jQuery .animate() 函数进行扩展。当 div 完成扩展时,高度会跳得更短。我做了一个 jsFiddle 但它在那里工作得很好。所以,它一定和我的其余内容有关。

Here's the site

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 animate()

并将 overflow:hidden 添加到示例页面上的 #tixcontainer 会停止跳转。

关于jQuery高度动画在动画完成时跳跃,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12906150/

相关文章:

javascript - 是否可以输入带有变量的背景图像大小?

jquery - 使用 Keith Wood 的 jQuery SVG 插件对外部加载的 SVG 进行动画处理

jquery - 使用延迟在中间暂停 jquery 动画。有一些问题

javascript - meteor : Blink data when updated

jquery - 如何使用 JQuery 将按钮移动到左侧?

firefox 4 中的 jQuery 动画速度(平滑度)

jquery - 删除移动设备的 ScrollTop 功能的问题

javascript - 浏览器支持使用 JavaScript 打开文件输入对话框

javascript - 隐藏显示切换和类更改多个 div

javascript - 使用循环在 JavaScript 中构建多维对象