IE6支持position:fixed完美解決方法
更新時(shí)間:2008年09月15日 22:56:03 作者:
IE7已經(jīng)支持position:fixed了,而我們的IE6呢?還繼續(xù)使用js事件?消耗資源,破壞結(jié)構(gòu),畫(huà)面閃耀。
今天去一老外站看到了這他站上的十分平滑但卻沒(méi)有js,好奇,原來(lái)。。巧妙啊,分享下,相對(duì)而言比較節(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)文章
仿客齊集首頁(yè)導(dǎo)航條DIV+CSS+JS [代碼實(shí)例]
仿客齊集首頁(yè)導(dǎo)航條DIV+CSS+JS [代碼實(shí)例]...2007-04-04DIV CSS網(wǎng)頁(yè)布局 最小高度(min-height)的妙用
最小高度可以設(shè)定一個(gè)BOX的最小高度,當(dāng)其內(nèi)容較少時(shí)時(shí),也能保持BOX的高度為一定,超出就自動(dòng)向下延伸,但到目前為止,只有Opera 和 Mozilla 支持,IE7開(kāi)始也支持了,但I(xiàn)E7處于測(cè)試階段,等正式版發(fā)布到普及需一段也許比較長(zhǎng)的時(shí)間,除非MS把它捆綁在某個(gè)操作系統(tǒng)上,如何在現(xiàn)有基礎(chǔ)上(IE6 80-90%),合理、妙用最小高度了?2008-11-11超級(jí)連接的提示中換行效果實(shí)現(xiàn)代碼
前段時(shí)間有網(wǎng)友在論壇發(fā)帖問(wèn)"如何實(shí)現(xiàn)超級(jí)連接的多行顯示",其實(shí)方法很簡(jiǎn)單就是使用title 和 alt就可以實(shí)現(xiàn)。2008-05-05推薦三種簡(jiǎn)潔的Tab導(dǎo)航(網(wǎng)頁(yè)選項(xiàng)卡)簡(jiǎn)析
推薦三種簡(jiǎn)潔的Tab導(dǎo)航(網(wǎng)頁(yè)選項(xiàng)卡)簡(jiǎn)析...2007-05-05學(xué)習(xí)樣式表CSS參考-常用的CSS知識(shí)
學(xué)習(xí)樣式表CSS參考-常用的CSS知識(shí)...2007-09-09