僞造固定位置我已經在這裏利用底部固定位置標頭的網站:http://www.entheospartners.com/newsite/在IE6
這種設置除了IE6,不支持在最不固定定位的所有瀏覽器的偉大工程,所以這裏是什麼我做:
當IE6用戶來到頁,我做出決定,如果滾動使用這段代碼是必要的:
var windowHeight = $(window).height();
var totalHeight = windowHeight - 100; // where 100 is the sum of the top nav height + footer height
var contentHeight;
if($('#subpage-content-small').length) { // main content div for a three column layout
contentHeight = $('#subpage-content-small').height();
};
if($('#subpage-content-wide').length) { // main content div for a two column layout
contentHeight = $('#subpage-content-wide').height();
};
if(contentHeight > totalHeight) {
$('#container-container').css({
'overflow-y' : "scroll",
'height' : totalHeight
});
};
...它正確地計算一切,把滾動條他們需要在哪裏(正確地衝洗),並將它們設置到適當的高度。問題是滾動條不會移動內容。我不能說我以前見過這樣的事情,所以我希望這裏有其他人。提前致謝!
PS - 顯然,這需要在IE6中查看故障排除,我知道這對你來說將會像對我一樣痛苦。
UPDATE
後多一點挖CSS表達式的基礎上,第一個答案,我來到了,對於固定的菜單定位到頁面頂部有效的解決方案。我需要的只是能夠使用它並將其應用到頁面的底部。這並不像將所有「頂部」切換到「底部」那麼簡單,所以我希望有人能夠啓發我。這裏的CSS:
#divfixed {
position: absolute;
top: expression(0+((e=document.documentElement.scrollTop)?e:document.body.scrollTop)+'px');
left: expression(0+((e=document.documentElement.scrollLeft)?e:document.body.scrollLeft)+'px');}
這不適合我。 – 2012-09-12 19:09:20