预览加载中,请您耐心等待几秒...
1/6
2/6
3/6
4/6
5/6
6/6

在线预览结束,喜欢就下载吧,查找使用更方便

如果您无法下载资料,请参考说明:

1、部分资料下载需要金币,请确保您的账户上有足够的金币

2、已购买过的文档,再次下载不重复扣费

3、资料包下载后请先用软件解压,在使用对应软件打开

JS广告代码漂浮效果分析 共有三个文件1.htm主文件、liangbian.js在两边漂浮的HYPERLINK"http://www.cnzixue.com/html/web/JS/index.html"代码、piaofu.js在全屏幕漂浮的HYPERLINK"http://www.cnzixue.com/html/web/JS/index.html"代码把他们的分别保存成三个文件,放在一个目录下,双击1.htm就可以看到效果了。//fromhttp://www.ik38.com/bbs大家可以根据需要更换图片和链接。1.htm<html><bodylink="#000000"vlink="#000000"><scriptlanguage=JavaScriptsrc="liangbian.js"></script><scriptlanguage=JavaScriptsrc="piaofu.js"></script></body></html>liangbian.js//左边varleft_img='<ahref=http://www.baidu.com/target=_blank><imgsrc=1.gifborder=0></a><br><br><ahref="http://www.ik38.com"target=_blank><imgsrc=2.gifborder=0></a>';//上边是两个左边的图片效果,不够可以继续加,HYPERLINK"http://www.cnzixue.com/html/web/JS/index.html"代码就是“<br><ahref="http://www.ik38.com"target=_blank><imgsrc=2.gifborder=0></a>”//右边varright_img='<ahref=http://www.baidu.com.cntarget=_blank><imgsrc=1.gifborder=0></a><br><br><ahref="http://www.ik38.com/"target=_blank><imgsrc=2.gifborder=0></a>';//varright_img='<EMBEDsrc=1.swfquality=highWIDTH=80HEIGHT=170TYPE="application/x-shockwave-flash"></EMBED>';vardelta=0.05varcollection;functionfloaters(){this.items=[];this.addItem=function(id,x,y,content){document.write('<DIVid='+id+'style="Z-INDEX:10;POSITION:absolute;width:80px;height:60px;left:'+(typeof(x)=='string'?eval(x):x)+';top:'+(typeof(y)=='string'?eval(y):y)+'">'+content+'</DIV>');varnewItem={};newItem.object=document.getElementById(id);newItem.x=x;newItem.y=y;this.items[this.items.length]=newItem;}this.play=function(){collection=this.itemssetInterval('play()',10);}}functionplay(){for(vari=0;i<collection.length;i++){varfollowObj=collection[i].object;varfollowObj_x=(typeof(collection[i].x)=='string'?eval(collection[i].x):collection[i].x);varfollowObj_y=(typeof(collection[i].y)=='string'?eval(collection[i].y):collection[i].y);if(followObj.offsetLeft!=(document.body.scrollLeft+followObj_x)){vardx=(document.body.scrollLeft+followObj_x-followObj.offsetLeft)*delta;dx=(dx>0?1:-1)*Math.ceil(Math.abs(dx));followObj.style.left=followObj.offsetLef