IE6fixed的完美解決方案_javascript技巧
來源:懂視網(wǎng)
責(zé)編:小采
時間:2020-11-27 20:58:35
IE6fixed的完美解決方案_javascript技巧
IE6fixed的完美解決方案_javascript技巧:第一種方法:純CSS 目前網(wǎng)上有的比較多的是這種解決方案(純CSS): 代碼如下: html{overflow:hidden;} body{height:100%;overflow:auto;} #rightform form{position:absolute;right:30px;top50px;} 這個方法有一個b
導(dǎo)讀IE6fixed的完美解決方案_javascript技巧:第一種方法:純CSS 目前網(wǎng)上有的比較多的是這種解決方案(純CSS): 代碼如下: html{overflow:hidden;} body{height:100%;overflow:auto;} #rightform form{position:absolute;right:30px;top50px;} 這個方法有一個b

第一種方法:純CSS
目前網(wǎng)上有的比較多的是這種解決方案(純CSS):
代碼如下:
html{overflow:hidden;}
body{height:100%;overflow:auto;}
#rightform form{position:absolute;right:30px;top50px;}
這個方法有一個bug未解決:在IE6下會把所有position:absolute都變成“浮動”的元素;還有使用js方法滾動滾動條時會出現(xiàn)對象閃爍,如下方法結(jié)合了CSS和js的辦法,解決了以上的問題。
代碼如下:
IE6 fixed 1111
show
只實現(xiàn)了垂直方向的fixed。若要實現(xiàn)水平方向的fixed,設(shè)置_left:expression(documentElement.scrollLeft + "px");
利用給
設(shè)置固定的背景,防止?jié)L動條滾動時的閃動;如果中要設(shè)置滾動的背景而產(chǎn)生沖突,可以把代碼寫在html選擇器里面,如:
代碼如下:
html {
_background-image: url(about:blank);
_background-attachment: fixed; /* prevent screen flash in IE6 */
}
body {
background-image: url(1.jpg);
background-attachment: scroll;
}
第二種方法 JavaScript
代碼如下:
測試內(nèi)容.........
測試內(nèi)容.........
測試內(nèi)容.........
測試內(nèi)容.........
測試內(nèi)容.........
測試內(nèi)容.........
測試內(nèi)容.........
測試內(nèi)容.........
測試內(nèi)容.........
測試內(nèi)容.........
測試內(nèi)容.........
測試內(nèi)容.........
測試內(nèi)容.........
測試內(nèi)容.........
浮動的內(nèi)容2
我的位置是固定的!拉動滾動條看效果。
ie6對postion:fixed的完美解決方案
今天去一老外站看到了這他站上的十分平滑但卻沒有js,好奇,原來。巧妙啊,分享下,相對而言比較節(jié)省資源。但效果好,使用方便,兼顧w3c。哈哈
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);
}
聲明:本網(wǎng)頁內(nèi)容旨在傳播知識,若有侵權(quán)等問題請及時與本網(wǎng)聯(lián)系,我們將在第一時間刪除處理。TEL:177 7030 7066 E-MAIL:11247931@qq.com
IE6fixed的完美解決方案_javascript技巧
IE6fixed的完美解決方案_javascript技巧:第一種方法:純CSS 目前網(wǎng)上有的比較多的是這種解決方案(純CSS): 代碼如下: html{overflow:hidden;} body{height:100%;overflow:auto;} #rightform form{position:absolute;right:30px;top50px;} 這個方法有一個b