一段解决ie6下position bug的js
| |
Posted in 技术 on April 23, 2007 / 引用(0)
这里看到的,测试通过。这下更有用position的理由了^^
// IE 6 hack to allow copy/paste
// thanks to Tom Gilder
http://blog.tom.me.uk/2003/07/23/boie6selecta.php
if (window.createPopup && document.compatMode && document.compatMode=="CSS1Compat"){
 document.onreadystatechange = onresize = function fixIE6AbsPos(){
   if (!document.body) return;
   if (document.body.style.margin != "0px") document.body.style.margin = 0;
   onresize = null;
   document.body.style.height = 0;
   setTimeout(function(){ document.body.style.height = document.documentElement.scrollHeight+"px"; }, 1);
   setTimeout(function(){ onresize = fixIE6AbsPos; }, 100);
 }
}

Update:来自yeyo的方法,还没测试
.test {position: absolute;}
* html .test {z-index: -1}

This entry comes from 本站原创 and has been read for 2550 times.It is tagged with .
0 Responses
发表评论

昵称

网址

电邮

OpenID登入 高级选项 表情