2011-11-05 126 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

相關問題