惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

W
WeLiveSecurity
T
The Exploit Database - CXSecurity.com
C
CXSECURITY Database RSS Feed - CXSecurity.com
S
Security @ Cisco Blogs
T
Threat Research - Cisco Blogs
TaoSecurity Blog
TaoSecurity Blog
Recent Commits to openclaw:main
Recent Commits to openclaw:main
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
腾讯CDC
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
T
The Blog of Author Tim Ferriss
Microsoft Azure Blog
Microsoft Azure Blog
罗磊的独立博客
F
Full Disclosure
博客园 - 【当耐特】
C
CERT Recently Published Vulnerability Notes
Engineering at Meta
Engineering at Meta
Application and Cybersecurity Blog
Application and Cybersecurity Blog
T
Threatpost
I
Intezer
V2EX - 技术
V2EX - 技术
H
Hackread – Cybersecurity News, Data Breaches, AI and More
The Hacker News
The Hacker News
小众软件
小众软件
Google DeepMind News
Google DeepMind News
T
Tailwind CSS Blog
D
Darknet – Hacking Tools, Hacker News & Cyber Security
B
Blog RSS Feed
Microsoft Security Blog
Microsoft Security Blog
N
News | PayPal Newsroom
MyScale Blog
MyScale Blog
AI
AI
Vercel News
Vercel News
Spread Privacy
Spread Privacy
美团技术团队
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
The GitHub Blog
The GitHub Blog
V
Vulnerabilities – Threatpost
Schneier on Security
Schneier on Security
Cyberwarzone
Cyberwarzone
G
GRAHAM CLULEY
Help Net Security
Help Net Security
Hacker News: Ask HN
Hacker News: Ask HN
Google DeepMind News
Google DeepMind News
MongoDB | Blog
MongoDB | Blog
L
LINUX DO - 热门话题
U
Unit 42
L
LangChain Blog
Recent Announcements
Recent Announcements

博客园 - senly

金财微报表的技术支持服务 党建积分的技术支持服务 PHP实现前台同步显示后台任务进度 css秘籍:复选框与文字对齐的问题 php遍历数组 list foreach each方法总结 jQuery cookie 购物车及其实现 CSS自定义滚动条样式 php根据ip查询所在地区(非常有用,赶集网就用到) iframe 父窗口和子窗口相互的调用方法集锦 44种IE css bug实例测试总结 IE6不支持position:fixed的解决方法 jQuery精仿手机上的翻牌效果菜单 jquery菜单左右翻屏效果 jQuery实现无限循环滚动公告 Load JSON data with jQuery, PHP and MySQL php把从数据库读取出来的数据存放到数组里 mysql 实现行号的方法——如何获取当前记录所在行号 DedeCMS会员排行调用代码,实现连接到会员空间 程序员们 不要想一辈子靠技术混饭吃
IE6的position:fixed
senly · 2013-07-21 · via 博客园 - senly

手头一个项目中,要实现把一个浮层控制在浏览器窗口右下角,用”position:fixed”来控制最合适不过了。

但万恶的IE6不支持这个属性,之前采用过的方法有:将滚动条转移到body上,使用绝对定位控制浮层位置;使用JS实时判断滚动并设置浮层位置。

第一种方法局限性太大,页面中有其他绝对定位元素会受到影响;第二种方法需要在页面里加定时器,资源开销和时间成本都有点高。

后来在同事小卓的启发下,使用CSS表达式完成了IE6的兼容,代码如下:

_position:absolute;

_top:expression(document.documentElement.clientHeight - 213 + (e=document.documentElement.scrollTop) +'px');

/*

document.documentElement.clientHeight : 浏览器串口高度

200 : 浮层高度

(e=document.documentElement.scrollTop) : 滚动条高度

 */