IE6支持position:fixed完美解決方法
更新時(shí)間:2008年09月15日 22:56:03 作者:
IE7已經(jīng)支持position:fixed了,而我們的IE6呢?還繼續(xù)使用js事件?消耗資源,破壞結(jié)構(gòu),畫面閃耀。
今天去一老外站看到了這他站上的十分平滑但卻沒有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);
}
復(fù)制代碼 代碼如下:
<!-- 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
復(fù)制代碼 代碼如下:
#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);
}
相關(guān)文章
仿客齊集首頁導(dǎo)航條DIV+CSS+JS [代碼實(shí)例]
仿客齊集首頁導(dǎo)航條DIV+CSS+JS [代碼實(shí)例]...2007-04-04DIV CSS網(wǎng)頁布局 最小高度(min-height)的妙用
最小高度可以設(shè)定一個(gè)BOX的最小高度,當(dāng)其內(nèi)容較少時(shí)時(shí),也能保持BOX的高度為一定,超出就自動(dòng)向下延伸,但到目前為止,只有Opera 和 Mozilla 支持,IE7開始也支持了,但I(xiàn)E7處于測試階段,等正式版發(fā)布到普及需一段也許比較長的時(shí)間,除非MS把它捆綁在某個(gè)操作系統(tǒng)上,如何在現(xiàn)有基礎(chǔ)上(IE6 80-90%),合理、妙用最小高度了?2008-11-11推薦三種簡潔的Tab導(dǎo)航(網(wǎng)頁選項(xiàng)卡)簡析
推薦三種簡潔的Tab導(dǎo)航(網(wǎng)頁選項(xiàng)卡)簡析...2007-05-05