让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. 4种动态加载JS的方法

    要实现动态加载JS脚本有4种方法: 1、直接document.write 复制代码 代码如下: script language=javascript document.write(script src=test.js\/script); /script 2、动态改变已有script的src属性 复制代码 代码如下: script src= id=s1/script script langu

  2. 仿站小工具 V6.0

    仿站小工具介绍: 仿站小工具是通过网址下载静态网页的工具。从输入的网址下载html代码,提取出JS、Css、Image、Picture、Flash等静态文件网址,再从下载完好的Css代码中提取出Image静态文件网址,通过网址下载静态文件,根据软件设置好的保存规则,自动修正

  3. a标签点击过后出现虚线的解决方法

    问题:a标签点击过后出现虚线 解决方法:a{blr:expression(this.onFocus=this.blur());outline: none;}

  4. JS屏蔽错误代码

    JS屏蔽错误代码,防止网页上的某些JS代码运行错误导致网页无法正常打开的问题。 复制代码 代码如下: script type=text/javascript function killerrors(){ return true; } window.onerror = killerrors; /script 将这段代码添加到其他JS代码之前才能起到效果

  5. Zepto.js手机页面上替代jQuery的最佳Javascript库

    Zepto.js手机页面上替代jQuery的最佳Javascript库,Zepto是现代的浏览器最大程度上与jQuery兼容的API,简约的JavaScript库 ,如果你使用jQuery,你已经知道如何使用的Zepto。 虽然100%的jQuery覆盖率不是一个设计目标, 提供的API相匹配的jQuery的同行 。

随机推荐

  1. 4种动态加载JS的方法

    要实现动态加载JS脚本有4种方法: 1、直接document.write 复制代码 代码如下: script language=javascript document.write(script src=test.js\/script); /script 2、动态改变已有script的src属性 复制代码 代码如下: script src= id=s1/script script langu

  2. 仿站小工具 V6.0

    仿站小工具介绍: 仿站小工具是通过网址下载静态网页的工具。从输入的网址下载html代码,提取出JS、Css、Image、Picture、Flash等静态文件网址,再从下载完好的Css代码中提取出Image静态文件网址,通过网址下载静态文件,根据软件设置好的保存规则,自动修正

  3. a标签点击过后出现虚线的解决方法

    问题:a标签点击过后出现虚线 解决方法:a{blr:expression(this.onFocus=this.blur());outline: none;}

  4. JS屏蔽错误代码

    JS屏蔽错误代码,防止网页上的某些JS代码运行错误导致网页无法正常打开的问题。 复制代码 代码如下: script type=text/javascript function killerrors(){ return true; } window.onerror = killerrors; /script 将这段代码添加到其他JS代码之前才能起到效果

  5. Zepto.js手机页面上替代jQuery的最佳Javascript库

    Zepto.js手机页面上替代jQuery的最佳Javascript库,Zepto是现代的浏览器最大程度上与jQuery兼容的API,简约的JavaScript库 ,如果你使用jQuery,你已经知道如何使用的Zepto。 虽然100%的jQuery覆盖率不是一个设计目标, 提供的API相匹配的jQuery的同行 。