动态设置div的高度和改变窗口的大小



如何在窗口调整大小的div,其中div是在其他div之间,我不能想到如何;但我想要那个div;有高度;在div下面;显示为页脚

好吧,我知道我说的没有意义,但这是我的意思:http://i44.tinypic.com/9v8t1u.jpg

换句话说,我正在尝试做http://www.tumblr.com对他们的索引所做的事情。"你会爱上Tumblr的30个理由"没有被定位为绝对和底部0,但他们已经将溢出设置为隐藏,并且每次窗口调整大小时他们都会改变中间div的高度。

我也在使用jQuery。

这并不是说我缺乏编码技能,但我只是想不出一种方法来执行Div3总是显示为页脚。

有人知道怎么做吗?

谢谢

您实际上不需要jQuery。看看这个css解决方案:http://ryanfait.com/sticky-footer/

* {
margin: 0;
}
html, body {
    height: 100%;
}
.wrapper {
    min-height: 100%;
    height: auto !important;
    height: 100%;
    margin: 0 auto -142px; /* the bottom margin is the negative value of the footer's height */
}
.footer, .push {
    height: 142px; /* .push must be the same height as .footer */
}
/*
Sticky Footer by Ryan Fait
http://ryanfait.com/
*/

可以使用jquery的。resize()事件链接如下:Jquery size调整API

最新更新