兼容 广告浮动层

<!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>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title></title>
</head>
<body>
</script><!--浮动开始 -->
<style type="text/css">
<!--
body
{ margin:0px; padding:0px;}
#w-cup
{position:fixed;position:absolute;width:200px;text-align:right;height:200px; background:#993333; right:0px;}
#w-cup .inner
{bottom:0;height:200px; background:#444; position:absolute; left:0px; width:200px;}
#w-cup .close
{display:block;color:#fff; white-space:nowrap;width:24px;position:absolute;top:0px;right:3px;font-size:12px; cursor:hand;}
#w-cup .open
{display:none; background:#0000FF; z-index:99; cursor:hand; position:absolute; bottom:0px; right:0px;}
-->
</style>
<script type="text/javascript">
function ff_(id){return document.getElementById(id);} //取ID的方法
if(navigator.userAgent.toLowerCase().indexOf("msie 6.0") != -1) //如果是ie6浏览器
{
window.setInterval(
function(){
var top = (document.documentElement.scrollTop?document.documentElement.scrollTop:document.body.scrollTop) + (document.documentElement.clientHeight?document.documentElement.clientHeight:document.body.clientHeight);
var left = (document.documentElement.clientWidth>document.body.clientWidth)&&(document.documentElement.clientWidth!=0)?document.documentElement.clientWidth:document.body.clientWidth;
ff_(
'w-cup').style.position = "absolute";
ff_(
'w-cup').style.top = (top - 200) +" px";

},
10);
}
</script>
<div id="w-cup" style="bottom:0; ">
<div class="inner" id="worldcup_float">
<div><br />dddddddddddd</div>
<div class="close" title="关闭" onclick="ff_('worldcup_float').style.display = 'none';ff_('worldcup_float_hide').style.display = 'inline-block';">关闭</div>
</div>
<div id="worldcup_float_hide" class="open" onclick="ff_('worldcup_float').style.display = 'block';ff_('worldcup_float_hide').style.display = 'none';">ggg</div>
</div>
<!--浮动结束--><br/>
ssssssssssssssss
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>

</body>
</html>

 

posted on 2010-09-28 11:24  lovening  阅读(233)  评论(0编辑  收藏  举报