且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

扩展列表不移动容器/页脚

更新时间:2023-11-01 21:21:16

#inside div设置了height属性.如果删除它,您将获得想要的行为.

The #inside div has an height property set. If you remove it, you'll get the behaviour you want.

编辑

似乎您正在通过javascript设置height属性,以便使div的height动画.

It seems you're setting the height property via javascript in order to animate the div's height.

在这种情况下,动画制作完成后,可以将height设置为auto,这样#inside div将尊重其子级height并正确展开.

In this case, after animation's been completed, you could set the height to auto, so the #inside div will respect its children's height and expand correctly.


$pageWrap.animate({
    height: baseHeight + $mainContent.height() + "px"
}, {
    complete: function(){
        $(this).css('height', 'auto');
    }
});