2011-11-05 205 views
0

我怎样才能调整大小的窗口调整大小,这是div之间的其他div和我想不出如何;但我想要那个div;有一个高度;所以它在div下面;显示为页脚。jQuery:动态设置div高度和窗口大小调整

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

换句话说,我试图做什么http://www.tumblr.com已经在他们的指数进行。 '你爱上Tumblr'的30个理由'并不是绝对的和最低的0,但他们已经设置了隐藏溢出,并且每当窗口调整大小时它们都会改变中间div的高度。

我也在使用jQuery。

这并不是说我缺乏编程技巧,但我无法想象执行Div3的方式总是显示为页脚。

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

非常感谢

回答

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/ 

*/ 
+0

正是我一直在寻找 – jQuerybeast

相关问题