固定位置浮動 DIV 不抖動 IE6 IE7 CSS 寫法

來源:互聯網
上載者:User

CSS:

body {background-image: url(text.txt); background-attachment: fixed;}
.float_up_controler {position: fixed; width: 58px; height: 58px; right: 30px; cursor: pointer; overflow: hidden; z-index: 9; _position: absolute; _top: expression(documentElement.scrollTop + documentElement.clientHeight - this.offsetHeight - 165); _left: expression(documentElement.scrollLeft + documentElement.clientWidth - this.offsetWidth - 30);}

HTML:

    <div id="scrollbar_up_controler" class="float_up_controler" style="bottom: 165px;" title="回到頂部">        <img src="./arrow_up.png" style="border: none;" onclick="javascript: window.scrollTo(0, 0);">    </div>

大家都知道 _top 是為IE6獨家準備的,但是當只加了上面這句時,IE6 下拉動捲軸看到的這個漂浮物是抖動的,解決方案是為 IE6 添加這樣一條語句:

background-image: url(text.txt);

注意這裡的 text.txt 其實不需要有這個 txt 文檔,txt 的檔案名稱叫什麼看自己喜好嘍,如此一來我們就解決了 IE6 下的抖動問題。

註:本文轉載自:http://blog.sina.com.cn/s/blog_5d8975f30100i4hd.html

相關文章

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.