0

如何在窗口调整大小时调整 div 的大小,该 div 位于其他 div 之间,我想不出如何;但我想要那个 div;要有高度;使其在 div 之下;显示为页脚。

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

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

我也在使用 jQuery。

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

有谁知道如何做到这一点?

非常感谢

4

2 回答 2

3

你真的不需要 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/

*/
于 2011-11-05T13:03:41.060 回答
0

您可以使用 jquery 的 .resize() 事件,这是链接: Jquery resize API

于 2011-11-05T13:13:58.753 回答