2022年对联广告代码效果大全源码精华教程.docx
![资源得分’ title=](/images/score_1.gif)
![资源得分’ title=](/images/score_1.gif)
![资源得分’ title=](/images/score_1.gif)
![资源得分’ title=](/images/score_1.gif)
![资源得分’ title=](/images/score_05.gif)
《2022年对联广告代码效果大全源码精华教程.docx》由会员分享,可在线阅读,更多相关《2022年对联广告代码效果大全源码精华教程.docx(11页珍藏版)》请在淘文阁 - 分享文档赚钱的网站上搜索。
1、2022年对联广告代码效果大全源码精华教程一般效果现在许多网站广告做的如火如荼,现在我就来介绍一下常见的对联浮动广告效果的代码运用方法,介绍的这种效果,在1024*768辨别率下正常显示,在800*600的辨别率下可以自动隐藏,以免遮住页面影响访问者阅读内容,下面就是实现效果所需代码:var delta=0.015 var collection; function floaters() { this.items = ;this.addItem = function(id,x,y,content) { document.write('<DIV id='+
2、id+' style=Z-INDEX: 0; POSITION: absolute; width:80px; height:60px;left:'+(typeof(x)='string'?eval(x):x)+'top:'+(typeof(y)='string'?eval(y):y)+'>'+content+'</DIV>'); var newItem= {} newItem.object = document.getElementById(id); newIt
3、em.x= x; newItem.y= y; this.itemsthis.items.length= newItem; } this.play = function() { collection= this.items setInterval('play()',10); } }function play(){ if(screen.width<=800) { for(var i=0;i<collection.length;i+){ collectioni.object.style.display
4、= 'none' }return; } for(var i=0;i<collection.length;i+) { var followObj= collectioni.object;var followObj_x= (typeof(collectioni.x)='string'?eval(collectioni.x):collectioni.x);var followObj_y= (typeof(collectioni.y)='string'?eval(collectioni.y):collectioni.y
5、);if(followObj.offsetLeft!=(document.body.scrollLeft+followObj_x) { var dx=(document.body.scrollLeft+followObj_x-followObj.offsetLeft)*delta; dx=(dx>0?1:-1)*Math.ceil(Math.abs(dx); followObj.style.left=followObj.offsetLeft+dx; } if(followObj.offsetTop!=(document.body.scrollTop+followObj
6、_y) { var dy=(document.body.scrollTop+followObj_y-followObj.offsetTop)*delta; dy=(dy>0?1:-1)*Math.ceil(Math.abs(dy); followObj.style.top=followObj.offsetTop+dy; } followObj.style.display = '' } } var theFloaters= new floaters(); theFloaters.addItem('followDiv1'
7、,'document.body.clientWidth-100',0,'</a><br><a href=广告链接地址 target=_blank><img src=广告图片地址 width=100 height=400 border=0></a>'); theFloaters.addItem('followDiv2',0,0,'<br><a href=广告链接地址 target=_blank><img src=广告图片地址 width=100 hei
8、ght=400 border=0></a>'); theFloaters.play(); 把上面的代码另存为一个JS文件,然后在想实现此效果的页面用 调用即可!留意修改广告图片地址和连接地址!鼠标感应与前面一个代码不同的是,当鼠标移动到广告图片上是可以感应显示另外设置好的广告大图效果,下面就是实现效果所需代码:function bigshow(){document.all.div_250.style.visibility = 'visible'document.all.div_80.style.visibility = 'hidden
9、'}function bighide(){document.all.div_80.style.visibility = 'visible'document.all.div_250.style.visibility = 'hidden'}var ad_80= new Array(1);var ad_250= new Array(1); ad_800=<a href= target=_blank><img src= border=0></a> ad_2500=<a href= targe
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 2022 对联 广告 代码 效果 大全 源码 精华 教程
![提示](https://www.taowenge.com/images/bang_tan.gif)
限制150内