让position:fixed在IE6下可用!

模板网 2014-09-13
/*让position:fixed在IE6下可用!*/
.fixed-top/*头部固定*/{position:fixed;bottom:auto;top:0px;}
.fixed-bottom/*底部固定*/{position:fixed;bottom:0px;top:auto;}
.fixed-left/*左侧固定*/{position:fixed;right:auto;left:0px;}
.fixed-right/*右侧固定*/{position:fixed;right:0px;left:auto;}
/*上面的是除了IE6的主流浏览器通用的方法*/
*html,*htmlbody/*修正IE6振动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右侧固定*/{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左侧固定*/{position:absolute;right:auto;left:expression(eval(document.documentElement.scrollLeft));} 

相关文章

  1. window.onerror()的详细用法

    window.onerror = function(sMessage,sUrl,sLine){}; onerror函数的三个参数用于确定错误确切的信息,代表的意思依次为:错误信息;发生错误的文件;发生错误的行号。 示例: 复制代码 代码如下: SCRIPT window.onerror=fnErrorTrap; function fnErrorTrap(s

  2. 让position:fixed在IE6下可用!

    /*让position:fixed在IE6下可用!*/ .fixed-top/*头部固定*/{position:fixed;bottom:auto;top:0px;} .fixed-bottom/*底部固定*/{position:fixed;bottom:0px;top:auto;} .fixed-left/*左侧固定*/{position:fixed;right:auto;left:0px;} .fixed-right/*右侧固定

  3. 手机站上离线宝被UC浏览器屏蔽解决方案

    手机站上离线宝被UC浏览器屏蔽解决方案,在手机站上使用离线宝发现在UC浏览器中被屏蔽了。页面上会有很大一块空白,怎么办? 利用一下代码可以解决离线宝被屏蔽时,去除头部空白。 复制代码 代码如下: document.writeln(script type=\text/javascript\ src=\

  4. CSS样式重置代码详细作用注释

    CSS样式重置代码详细作用注释,解决因不同浏览器样式解析方面存在的差异导致页面布局不统一的问题。代码包含详细注释,方便理解与修改。 详细代码: 复制代码 代码如下: @charset utf-8; /* ---------------------------------------- reset.css Description

  5. 手机站布局中viewport的作用详解

    什么是Viewport?手机浏览器是把页面放在一个虚拟的窗口(viewport)中,通常这个虚拟的窗口(viewport)比屏幕宽,这样就不用把每个网页挤到很小的窗口中(这样会破坏没有针对手机浏览器优化的网页的布局),用户可以通过平移和缩放来看网页的不同部分。移动

随机推荐

  1. window.onerror()的详细用法

    window.onerror = function(sMessage,sUrl,sLine){}; onerror函数的三个参数用于确定错误确切的信息,代表的意思依次为:错误信息;发生错误的文件;发生错误的行号。 示例: 复制代码 代码如下: SCRIPT window.onerror=fnErrorTrap; function fnErrorTrap(s

  2. 让position:fixed在IE6下可用!

    /*让position:fixed在IE6下可用!*/ .fixed-top/*头部固定*/{position:fixed;bottom:auto;top:0px;} .fixed-bottom/*底部固定*/{position:fixed;bottom:0px;top:auto;} .fixed-left/*左侧固定*/{position:fixed;right:auto;left:0px;} .fixed-right/*右侧固定

  3. 手机站上离线宝被UC浏览器屏蔽解决方案

    手机站上离线宝被UC浏览器屏蔽解决方案,在手机站上使用离线宝发现在UC浏览器中被屏蔽了。页面上会有很大一块空白,怎么办? 利用一下代码可以解决离线宝被屏蔽时,去除头部空白。 复制代码 代码如下: document.writeln(script type=\text/javascript\ src=\

  4. CSS样式重置代码详细作用注释

    CSS样式重置代码详细作用注释,解决因不同浏览器样式解析方面存在的差异导致页面布局不统一的问题。代码包含详细注释,方便理解与修改。 详细代码: 复制代码 代码如下: @charset utf-8; /* ---------------------------------------- reset.css Description

  5. 手机站布局中viewport的作用详解

    什么是Viewport?手机浏览器是把页面放在一个虚拟的窗口(viewport)中,通常这个虚拟的窗口(viewport)比屏幕宽,这样就不用把每个网页挤到很小的窗口中(这样会破坏没有针对手机浏览器优化的网页的布局),用户可以通过平移和缩放来看网页的不同部分。移动