当前位置:
编程学习 >
JS >>
javascript 右下角浮动广告代码
document.writeln("<div id="qqaddiv" style="position:absolute; z-index: 100;"> ");
document.writeln("<a href=http://www.zhutiai.com/ target=_blank onclick='closer()'><img src=/images/xxxxzz.gif border=0></a>");
document.writeln("</div>");
var bodyfrm = ( document.compatmode.tolowercase()=="css教程1compat" ) ? document.documentelement : document.body;
var adst = document.getelementbyid("qqaddiv").style;
adst.top = ( bodyfrm.clientheight - 156 ) + "px";
adst.left = ( bodyfrm.clientwidth - 254 ) + "px";
function mover() {
adst.top = ( bodyfrm.scrolltop + bodyfrm.clientheight - 156 ) + "px";
adst.left = ( bodyfrm.scrollleft + bodyfrm.clientwidth - 254 ) + "px";
}
//就是这个函数,设置adst的display属性为none就行了
function closer(){
adst.display="none";
}
setinterval("mover();", 80);
补充:网页制作,js教程