网页常用JS代码-对联广告代码
[08-08 00:47:11] 来源:http://www.xuehuiba.com 网页特效代码 阅读:8279次
概要:<P>document.write("</td></tr><tr><td width=80 height=20 <BR>align=right><a href='nojavascript...close_float_left();void(0);' <BR>class=closefloat><b><font color=#ff0000>关闭</font></b></a></td></tr>"<BR>+"</table>"<BR>+"</div>");</P><P>myload()} <BR>把上面的代码另存为一个*.JS文件,然后在想实现此效果的页面用</P>&
网页常用JS代码-对联广告代码,标签:网页图像特效代码,网页特效代码下载,http://www.xuehuiba.com
<P>document.write("</td></tr><tr><td width=80 height=20 <BR>align=right><a href='nojavascript...close_float_left();void(0);' <BR>class=closefloat><b><font color=#ff0000>关闭</font></b></a></td></tr>"<BR>+"</table>"<BR>+"</div>");</P>
<P>myload()} <BR>把上面的代码另存为一个*.JS文件,然后在想实现此效果的页面用</P>
<P><BR><script src="*.js"></SCRIPT><BR>调用即可,*代表你另存的文件名!注意修改广告图片地址和连接地址!相应的参数可以根据页面自行调整。</P>
<P>
<P>带关闭按钮的对联广告代码<BR>把以下文字存成js文件,比如ad.js。然后替换代码中的SWF地址。</P>
<P>var delta=0.015;<BR>var collection;<BR>var closeB=false;<BR>function floaters() {<BR>this.items = [];<BR>this.addItem = function(id,x,y,content)<BR>{<BR>document.write('<DIV id='+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>');</P>
<P>var newItem = {};<BR>newItem.object = document.getElementById(id);<BR>newItem.x = x;<BR>newItem.y = y;</P>
<P>this.items[this.items.length] = newItem;<BR>}<BR>this.play = function()<BR>{<BR>collection = this.items<BR>setInterval('play()',1);<BR>}<BR>}<BR>function play()<BR>{<BR>if(screen.width<=800 || closeB)<BR>{<BR>for(var i=0;i<collection.length;i++)<BR>{<BR>collection[i].object.style.display = 'none';<BR>}<BR>return;<BR>}<BR>for(var i=0;i<collection.length;i++)<BR>{<BR>var followObj = collection[i].object;<BR>var followObj_x = (typeof(collection[i].x)=='string'?eval(collection[i].x):collection[i].x);<BR>var followObj_y = (typeof(collection[i].y)=='string'?eval(collection[i].y):collection[i].y);</P>
<P>if(followObj.offsetLeft!=(document.body.scrollLeft+followObj_x)) {<BR>var dx=(document.body.scrollLeft+followObj_x-followObj.offsetLeft)*delta;<BR>dx=(dx>0?1:-1)*Math.ceil(Math.abs(dx));<BR>followObj.style.left=followObj.offsetLeft+dx;<BR>}</P>
<P>if(followObj.offsetTop!=(document.body.scrollTop+followObj_y)) {<BR>var dy=(document.body.scrollTop+followObj_y-followObj.offsetTop)*delta;<BR>dy=(dy>0?1:-1)*Math.ceil(Math.abs(dy));<BR>followObj.style.top=followObj.offsetTop+dy;<BR>}<BR>followObj.style.display = '';<BR>}<BR>} <BR>function closeBanner()<BR>{<BR>closeB=true;<BR>return;<BR>}</P>
<P>var theFloaters = new floaters();<BR>//<BR>theFloaters.addItem('followDiv1','document.body.clientWidth-105',110,'<a href=job.asp target=_blank><embed it/200710/lu/403.swf quality=high pluginspage=http://www.macromedia.com/go/getflashplayer type=application/x-shockwave-flash height=280 width=95></embed></a><br><img it/200710/ads/close.gif >');<BR>theFloaters.addItem('followDiv2',5,110,'<a href=job.asp target=_blank><embed it/200710/lu/402.swf quality=high pluginspage=http://www.macromedia.com/go/getflashplayer type=application/x-shockwave-flash height=280 width=95></embed></a><br><img it/200710/ads/close.gif >');<BR>theFloaters.play();</P>
---------------------------代码结束-----------------------------电脑知识
<P>document.write("</td></tr><tr><td width=80 height=20 <BR>align=right><a href='nojavascript...close_float_left();void(0);' <BR>class=closefloat><b><font color=#ff0000>关闭</font></b></a></td></tr>"<BR>+"</table>"<BR>+"</div>");</P>
<P>myload()} <BR>把上面的代码另存为一个*.JS文件,然后在想实现此效果的页面用</P>
<P><BR><script src="*.js"></SCRIPT><BR>调用即可,*代表你另存的文件名!注意修改广告图片地址和连接地址!相应的参数可以根据页面自行调整。</P>
<P>
<P>带关闭按钮的对联广告代码<BR>把以下文字存成js文件,比如ad.js。然后替换代码中的SWF地址。</P>
<P>var delta=0.015;<BR>var collection;<BR>var closeB=false;<BR>function floaters() {<BR>this.items = [];<BR>this.addItem = function(id,x,y,content)<BR>{<BR>document.write('<DIV id='+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>');</P>
<P>var newItem = {};<BR>newItem.object = document.getElementById(id);<BR>newItem.x = x;<BR>newItem.y = y;</P>
<P>this.items[this.items.length] = newItem;<BR>}<BR>this.play = function()<BR>{<BR>collection = this.items<BR>setInterval('play()',1);<BR>}<BR>}<BR>function play()<BR>{<BR>if(screen.width<=800 || closeB)<BR>{<BR>for(var i=0;i<collection.length;i++)<BR>{<BR>collection[i].object.style.display = 'none';<BR>}<BR>return;<BR>}<BR>for(var i=0;i<collection.length;i++)<BR>{<BR>var followObj = collection[i].object;<BR>var followObj_x = (typeof(collection[i].x)=='string'?eval(collection[i].x):collection[i].x);<BR>var followObj_y = (typeof(collection[i].y)=='string'?eval(collection[i].y):collection[i].y);</P>
<P>if(followObj.offsetLeft!=(document.body.scrollLeft+followObj_x)) {<BR>var dx=(document.body.scrollLeft+followObj_x-followObj.offsetLeft)*delta;<BR>dx=(dx>0?1:-1)*Math.ceil(Math.abs(dx));<BR>followObj.style.left=followObj.offsetLeft+dx;<BR>}</P>
<P>if(followObj.offsetTop!=(document.body.scrollTop+followObj_y)) {<BR>var dy=(document.body.scrollTop+followObj_y-followObj.offsetTop)*delta;<BR>dy=(dy>0?1:-1)*Math.ceil(Math.abs(dy));<BR>followObj.style.top=followObj.offsetTop+dy;<BR>}<BR>followObj.style.display = '';<BR>}<BR>} <BR>function closeBanner()<BR>{<BR>closeB=true;<BR>return;<BR>}</P>
<P>var theFloaters = new floaters();<BR>//<BR>theFloaters.addItem('followDiv1','document.body.clientWidth-105',110,'<a href=job.asp target=_blank><embed it/200710/lu/403.swf quality=high pluginspage=http://www.macromedia.com/go/getflashplayer type=application/x-shockwave-flash height=280 width=95></embed></a><br><img it/200710/ads/close.gif >');<BR>theFloaters.addItem('followDiv2',5,110,'<a href=job.asp target=_blank><embed it/200710/lu/402.swf quality=high pluginspage=http://www.macromedia.com/go/getflashplayer type=application/x-shockwave-flash height=280 width=95></embed></a><br><img it/200710/ads/close.gif >');<BR>theFloaters.play();</P>
---------------------------代码结束-----------------------------电脑知识
Tag:网页特效代码,网页图像特效代码,网页特效代码下载,电脑知识学习 - 网页制作 - 网页特效代码
最新更新
- · 常用网页漂浮广告代码
- · 退出弹窗代码
- · 网页漂浮广告代码
- · 网页浮动广告代码
- · 网页特效:跟随鼠标的图片的网页代码
- · 左右两边浮动广告特效代码
- · 星期查询!可设置任意、年、月、日
- · 真正的万年历(挺酷的!)
- · 文本框内显示时间的脚本
- · 能记事的万年历特效代码
推荐热门