IE6支持position:fixed完美解決方法
更新時間:2008年09月15日 22:56:03 作者:
IE7已經(jīng)支持position:fixed了,而我們的IE6呢?還繼續(xù)使用js事件?消耗資源,破壞結(jié)構,畫面閃耀。
今天去一老外站看到了這他站上的十分平滑但卻沒有js,好奇,原來。。巧妙啊,分享下,相對而言比較節(jié)省資源。但效果好,使用方便,兼顧w3c。哈哈
<!-- compliance patch for microsoft browsers -->
<!--[if lt IE 7]><link rel="stylesheet" href="ie-stuff.css" type="text/css" media="screen"/><![endif]-->
ie-stuff.css
#footer {
position: absolute;
bottom: auto;
clear: both;
top:expression(eval(document.compatMode &&
document.compatMode=='CSS1Compat') ?
documentElement.scrollTop
+(documentElement.clientHeight-this.clientHeight) - 1
: document.body.scrollTop
+(document.body.clientHeight-this.clientHeight) - 1);
}
復制代碼 代碼如下:
<!-- compliance patch for microsoft browsers -->
<!--[if lt IE 7]><link rel="stylesheet" href="ie-stuff.css" type="text/css" media="screen"/><![endif]-->
ie-stuff.css
復制代碼 代碼如下:
#footer {
position: absolute;
bottom: auto;
clear: both;
top:expression(eval(document.compatMode &&
document.compatMode=='CSS1Compat') ?
documentElement.scrollTop
+(documentElement.clientHeight-this.clientHeight) - 1
: document.body.scrollTop
+(document.body.clientHeight-this.clientHeight) - 1);
}
相關文章
DIV CSS網(wǎng)頁布局 最小高度(min-height)的妙用
最小高度可以設定一個BOX的最小高度,當其內(nèi)容較少時時,也能保持BOX的高度為一定,超出就自動向下延伸,但到目前為止,只有Opera 和 Mozilla 支持,IE7開始也支持了,但IE7處于測試階段,等正式版發(fā)布到普及需一段也許比較長的時間,除非MS把它捆綁在某個操作系統(tǒng)上,如何在現(xiàn)有基礎上(IE6 80-90%),合理、妙用最小高度了?2008-11-11