兼容IE6的淘宝悬浮工具栏
2010-12-22 17:41
232 查看
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title> </title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<style type="text/css">
body,html{margin:0;padding:0;font-size:12px;font-family:Arial;font:12px/1 Helvetica, Tahoma, Arial, /5b8b/4f53, sans-serif;background:url(/100100759.png) fixed}
#float{background:url(http://www.css88.com/wp-content/uploads/2009/10/tb2.png) no-repeat -12px -37px;width:744px;height:34px;border:1px solid #C0DBF8;position:absolute;top:0}
#box{position:relative;height:500px;width:744px;background:#ddd url(http://home.blueidea.com/attachment/201004/9/506384_1270823833Kkk2.jpg) no-repeat;}
</style>
</head>
<body>
<div style="height:300px;background:#eee"></div>
<div id="box"><div id="float" ></div>123</div>
<div style="height:1000px;background:#eee"></div>
</body>
<script type="text/javascript">
var IO=document.getElementById('float'),Y=IO,H=0,IE6;
IE6=window.ActiveXObject&&!window.XMLHttpRequest;
while(Y){H+=Y.offsetTop;Y=Y.offsetParent};
if(IE6)
IO.style.cssText="position:absolute;top:expression(this.fix?(document"+
".documentElement.scrollTop-(this.javascript||"+H+")):0)";
window.onscroll=function (){
var d=document,s=Math.max(d.documentElement.scrollTop,document.body.scrollTop);
if(s>H&&IO.fix||s<=H&&!IO.fix)return;
if(!IE6)IO.style.position=IO.fix?"":"fixed";
IO.fix=!IO.fix;
};
try{document.execCommand("BackgroundImageCache",false,true)}catch(e){};
//]]>
</script>
</html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title> </title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<style type="text/css">
body,html{margin:0;padding:0;font-size:12px;font-family:Arial;font:12px/1 Helvetica, Tahoma, Arial, /5b8b/4f53, sans-serif;background:url(/100100759.png) fixed}
#float{background:url(http://www.css88.com/wp-content/uploads/2009/10/tb2.png) no-repeat -12px -37px;width:744px;height:34px;border:1px solid #C0DBF8;position:absolute;top:0}
#box{position:relative;height:500px;width:744px;background:#ddd url(http://home.blueidea.com/attachment/201004/9/506384_1270823833Kkk2.jpg) no-repeat;}
</style>
</head>
<body>
<div style="height:300px;background:#eee"></div>
<div id="box"><div id="float" ></div>123</div>
<div style="height:1000px;background:#eee"></div>
</body>
<script type="text/javascript">
var IO=document.getElementById('float'),Y=IO,H=0,IE6;
IE6=window.ActiveXObject&&!window.XMLHttpRequest;
while(Y){H+=Y.offsetTop;Y=Y.offsetParent};
if(IE6)
IO.style.cssText="position:absolute;top:expression(this.fix?(document"+
".documentElement.scrollTop-(this.javascript||"+H+")):0)";
window.onscroll=function (){
var d=document,s=Math.max(d.documentElement.scrollTop,document.body.scrollTop);
if(s>H&&IO.fix||s<=H&&!IO.fix)return;
if(!IE6)IO.style.position=IO.fix?"":"fixed";
IO.fix=!IO.fix;
};
try{document.execCommand("BackgroundImageCache",false,true)}catch(e){};
//]]>
</script>
</html>
相关文章推荐
- 兼容IE6的淘宝悬浮工具栏
- 很牛的悬浮样式(兼容ie6,ie7,firefox)
- 如何制作自动置顶的悬浮工具条(兼容IE6)?
- 在页面左右一个悬浮div兼容IE6 IE7 8 9 Firefox chrome
- JS仿淘宝固定悬浮工具栏,兼容性不错
- css 悬浮div效果(兼容ie6)
- 仿淘宝头像上传功能(三)——兼容 IE6 浏览器。
- JS实现兼容性好,自动置顶的淘宝悬浮工具栏效果
- JS实现兼容性好,自动置顶的淘宝悬浮工具栏效果
- 悬浮固定在右下角,会自动隐藏,兼容ie6
- 仿淘宝的浮动工具栏(兼容IE6和其他浏览器)
- 不用JS也能让工具栏悬浮于网页顶部(兼容所有浏览器)
- CSS实现div悬浮框的代码(兼容IE6)
- 黄聪:IE6如何实现悬浮框的兼容CSS代码
- 仿淘宝悬浮顶部工具栏 之 方法二改进
- ie6不继承a:hover img这种伪类用zoom:1解决【IE浏览器兼容】
- CSS HACK(ie6-ie7-fox 兼容)
- javascript 兼容 IE6、IE7、FF 的“加入收藏”
- B/S网站中IE6兼容问题
- IE6以及各个浏览器常见兼容问题 大汇总 【转】