您的位置:首页 > 编程语言

多浏览器兼容的右下角广告代码(已测)

2008-04-11 00:00 337 查看
查了N多的资料,现在终于解决了,MD,自已写了一个,代码很简单!在FIREFOX IE7 IE6中我测了,没有问题,我想有很多都也在找这样的代码,贴出来和大家分享吧!

<div style="position:absolute;border:1px solid #000;right:0;" id="ad"><a href="http://www.zishu.cn">子鼠测试.</a></div>  

//这一行写了这个DIV是绝对定位,最好再加一下z-index;边框为1px的实线黑色边;距右边有0PX; ID=AD;  
<script language="JavaScript" type="text/javascript">  

function rightBottomAd(){  

 var abc = document.getElementById("ad");  

 abc.style.top = document.documentElement.scrollTop+document.documentElement.clientHeight-20+"px";//20是这个层的高度;   

 setTimeout(function(){rightBottomAd();},50);  

}  

rightBottomAd();  

</script>









脚本之家 www.jb51.net





脚本之家测试.



function rightBottomAd(){

var abc = document.getElementById("ad");

abc.style.top = document.documentElement.scrollTop+document.documentElement.clientHeight-20+"px";

setTimeout(function(){rightBottomAd();},50);

}

rightBottomAd();


















































































[Ctrl+A 全选 注:如需引入外部Js需刷新才能执行]
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: