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

问题描述:

我有一个网站,当您展开其中一个列表项时,您可以在此处找到,我无法弄清楚为什么页面的整个高度都没有被修改(页脚不会随着列表扩展而移动).有任何想法吗?预先感谢

I have a website you can find here, when expanding one of the list items, I can't figure out why the the entire height of the page isn't being modified (footer doesn't move with list expansion). Any ideas? thanks in advance

#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');
    }
});