网站首页飘动图片+链接代码
2009-10-08 13:18:23| 分类:
电脑应用
| 标签:
|举报
|字号大中小 订阅
<DIV id=img style=position:absolute;width:200;height:200;left:12;top:5>
<a href=链接地址 target=_blank><img src="图片地址" width="80" height="120" border="1"> <SCRIPT language=JavaScript><!-- Begin
var xPos=20;var yPos=document.body.clientHeight;var step=1;var delay=40;var height=0;var Hoffset=0;var Woffset=0;var yon=0;var xon=0;var pause=true;var interval;img.style.top=yPos;function changePos(){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(yPos<0){yon=1;yPos=0;}if(yPos>=(height-Hoffset)){yon=0;yPos=(height-Hoffset);}if(xon){xPos=xPos+step;}else{xPos=xPos-step;}if(xPos<0){xon=1;xPos=0;}if(xPos>=(width-Woffset)){xon=0;xPos=(width-Woffset);}}function start(){img.visibility='visible';interval=setInterval('changePos()',delay);}start();//--></SCRIPT></div>
评论这张
转发至微博
转发至微博
评论