【问题标题】:jQuery height animation jumps when animation is complete [duplicate]动画完成时jQuery高度动画跳跃[重复]
【发布时间】:2012-10-16 01:01:31
【问题描述】:

我有一组按钮,当单击这些按钮时,页面上的说明会淡出,而所需的内容会淡入。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 jquery-animate


    【解决方案1】:

    这看起来是同一个问题:

    jQuery animate()

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2012-03-19
      • 1970-01-01
      • 1970-01-01
      • 2011-10-07
      • 1970-01-01
      • 1970-01-01
      • 2012-04-20
      • 2014-07-08
      相关资源
      最近更新 更多