中文字幕亚洲欧美一区_国产JIZZJIZZ免费看_亚洲av大码在线_亚洲黄色一级毛片_野花影视大全在线观看免费_欧美一区二区三区免费不卡_欧美日韩国产在线精品_国产福利盒子在线看片_精品国产人成在线_日韩欧美动漫一区在线

咨詢電話:024-31891684

網(wǎng)站建設(shè)|注冊(cè)|登錄 | 易勢(shì)大連分公司

沈陽(yáng)網(wǎng)站制作易勢(shì)最專(zhuān)業(yè)!

 

【IE6】如何讓position:fixed在ie6中工作當(dāng)前位置:首頁(yè)>主要服務(wù)>網(wǎng)站制作>html

IE6BUG之不支持position:fixed

 

本文所使用的技巧是用了一條Internet Explorer的CSS表達(dá)式(expression)。你不可以直接使用該表達(dá)式,因?yàn)樗赡軙?huì)因?yàn)榫彺娑桓?。解決這一點(diǎn)的最簡(jiǎn)單的方式是使用eval包裹你的語(yǔ)句。

 

下面是樣式,把這個(gè)加在CSS里,然后按需求引用。

 

/*讓position:fixed在IE6下可用! */ 

.fixed-top/* 頭部固定 */{position:fixed;bottom:auto;top:0px;} 

.fixed-bottom/* 底部固定 */{position:fixed;bottom:0px;top:auto;} 

.fixed-left/* 左側(cè)固定 */{position:fixed;right:auto;left:0px;} 

.fixed-right/* 右側(cè)固定 */{position:fixed;right:0px;left:auto;}

/* 上面的是除了IE6的主流瀏覽器通用的方法 */

* html,* html body /* 修正IE6振動(dòng)bug */{background-image:url(about:blank);background-attachment:fixed;}

* html .fixed-top/* IE6 頭部固定 */{position:absolute;bottom:auto;top:expression(eval(document.documentElement.scrollTop));}

* html .fixed-right/* IE6 右側(cè)固定 */{position:absolute;right:auto;left:expression(eval(document.documentElement.scrollLeft+document.documentElement.clientWidth-this.offsetWidth)-(parseInt(this.currentStyle.marginLeft,10)||0)-(parseInt(this.currentStyle.marginRight,10)||0));}

* html .fixed-bottom/* IE6 底部固定  */{position:absolute;bottom:auto;top:expression(eval(document.documentElement.scrollTop+document.documentElement.clientHeight-this.offsetHeight-(parseInt(this.currentStyle.marginTop,10)||0)-(parseInt(this.currentStyle.marginBottom,10)||0)));}

* html .fixed-left/* IE6 左側(cè)固定 */{position:absolute;right:auto;left:expression(eval(document.documentElement.scrollLeft));}    

上一條資訊|返回欄目頁(yè)|下一條資訊

沈陽(yáng)網(wǎng)站制作--網(wǎng)站前臺(tái)效果

易勢(shì)網(wǎng)站制作,以DIV+CSS為主,js/jQuery為輔,制作利于優(yōu)化,頁(yè)面美觀的優(yōu)質(zhì)網(wǎng)站!

top

網(wǎng)絡(luò)策劃公司|新浪官方微博|大連網(wǎng)站建設(shè)