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)))

    }

  • 相关阅读:
    yzoj P2344 斯卡布罗集市 题解
    yzoj P2350 逃离洞穴 题解
    yzoj P2349 取数 题解
    JXOI 2017 颜色 题解
    NOIP 2009 最优贸易 题解
    CH 4302 Interval GCD 题解
    CH4301 Can you answer on these queries III 题解
    Luogu2533[AHOI2012]信号塔
    Luogu3320[SDOI2015]寻宝游戏
    Luogu3187[HNOI2007]最小矩形覆盖
  • 原文地址:https://www.cnblogs.com/bigdesign/p/4037226.html
Copyright © 2011-2022 走看看