当前位置: 首页 > 图文教程 > 网页制作 > CSS样式表 > IE6支持position:fixed完美解决方法

CSS样式表
CSS中box(盒模式)的分析
CSS2快速参考
CSS布局入门
怎么改善现有网站
display&position
表格斜线
转载:On having layout
标准化你的网页
HTML技巧汇编
动态CSS站点教程:多个页面样式提供浏览者选择
鲜为人知的CSS技巧10则
详谈 CSS样式表使用:链接/嵌入
W3C标准:实时切换CSS样式
On having layout
XHTML与HTML之间的区别
XHTML标准语法
针对浏览器隐藏CSS
CSS基础学习
130个漂亮CSS布局站点参考
css技巧十条

CSS样式表 中的 IE6支持position:fixed完美解决方法


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-10-12   浏览: 137 ::
收藏到网摘: n/a

IE7已经支持position:fixed了,而我们的IE6呢?还继续使用js事件?消耗资源,破坏结构,画面闪耀。 今天去一老外站看到了这他站上的十分平滑但却没有js,好奇,原来。。巧妙啊,分享下,相对而言比较节省资源。但效果好,使用方便,兼顾w3c。哈哈
复制代码 代码如下:

<!-- compliance patch for microsoft browsers -->
<!--[if lt IE 7]><link rel="stylesheet" href="ie-stuff.css" type="text/css" media="screen"/><![endif]-->

ie-stuff.css
复制代码 代码如下:

#footer {
position: absolute;
bottom: auto;
clear: both;
top:e­xpression(eval(document.compatMode &&
document.compatMode=='CSS1Compat') ?
documentElement.scrollTop
+(documentElement.clientHeight-this.clientHeight) - 1
: document.body.scrollTop
+(document.body.clientHeight-this.clientHeight) - 1);
}