zoukankan      html  css  js  c++  java
  • ie6 fixed不兼容

    让IE6支持fixed的处理方式

    IE6代码

    <!--[if IE 6]>

    <style type="text/css">

    html{overflow:hidden}

    body{height:100%; overflow:auto;}

    </style>

    <![endif]-->

    这个方法可以使ie6支持fixed,但有个缺陷,会使页面上原有的relative 和 position 定位都变成 fixed的效果。

    解决方式:

    用expression 可以让IE实现页面固定,

    但是会出现抖动,通过设置 background-image 解决抖动,无需一张真实的图片。

    * html , * html body{

    background-image:url(about:blank);

    background-attachment:fixed;

    }

    * html .box{   /* Top Left */

    position:absolute;

    left:expression(eval(document.documentElement.scrollLeft+100));

    top:expression(eval(document.documentElement.scrollTop+100));

    * html .box2{   /* Right Bottom  */

    position:absolute;

    left:expression(eval(document.documentElement.scrollLeft+document.documentElement.clientWidth-this.offsetWidth)-(parseInt(this.currentStyle.marginLeft,10)||0)-(parseInt(this.currentStyle.marginRight,10)||0));

    top:expression(eval(document.documentElement.scrollTop+document.documentElement.clientHeight-this.offsetHeight-(parseInt(this.currentStyle.marginTop,10)||0)-(parseInt(this.currentStyle.marginBottom,10)||0)))

    }

  • 相关阅读:
    js看懂funid与funname各自的作用以及回显示是怎么找到对应位置的
    居然脑海中还记得03年的瑞星升级ID号
    [恢]hdu 2186
    [恢]hdu 2109
    [恢]hdu 2140
    [恢]hdu 2160
    [恢]hdu 2101
    [恢]hdu 2162
    [恢]hdu 2201
    [恢]hdu 2163
  • 原文地址:https://www.cnblogs.com/bigdesign/p/4037226.html
Copyright © 2011-2022 走看看