html
head
-="-Type"=";=GBK"
带关闭按钮的网页漂浮广告代码
body
divid="img"style="position:absolute;left:311;top:815;visibility:hidden;"οnmοuseοver="clearInterval(interval)"οnmοuseοut="interval=setInterval('changePos()',delay)"align="right"
imgborder="0"src="https://static3.51cto.com/home/web/p_w_picpaths/Flogo.png"οnlοad="returnimgzoom(this,600);"οnclick="javascript:window.open(this.src);"style="cursor:pointer;"/
spanstyle="CURSOR:hand;color:red;font-weight:bold"οnclick="clearInterval(interval);img.style.visibility='hidden'"X/span
/div
scriptlanguage=javascript
varxPos=20;//fromalixixi.com
varyPos=document.body.clientHeight;
varstep=1;
vardelay=30;
varheight=0;
varHoffset=0;
varWoffset=0;
varyon=0;
varxon=0;
varpause=true;
varinterval;
img.style.top=yPos;
functionchangePos(){
width=document.body.clientWidth;
height=document.body.clientHeight;
Hoffset=img.offsetHeight;
Woffset=img.offsetWidth;
img.style.left=xPos+document.body.scrollLeft;
img.style.top=yPos+document.body.scrollTop;
if(yon){
yPos=yPos+step;
}
else{
yPos=yPos-step;
}
if(yPos0){
yon=1;
yPos=0;
}
if(yPos=(height-Hoffset)){
yon=0;
yPos=(height-Hoffset);
}
if(xon){
xPos=xPos+step;
}
else{
xPos=xPos-step;
}
if(xPos0){
xon=1;
xPos=0;
}
if(xPos=(width-Woffset)){
xon=0;
xPos=(width-Woffset);
}
}
functionstart(){
img.style.visibility="visible";
interval=setInterval('changePos()',delay);
}
start();
/script
/body
/html