资源预览内容
第1页 / 共4页
第2页 / 共4页
第3页 / 共4页
第4页 / 共4页
亲,该文档总共4页全部预览完了,如果喜欢就下载吧!
资源描述
/*-功能说明:防止被浏览器屏蔽的浮动对联广告程序,可自定义个广告个数和显示位置,可以定义flash和图片广告-参数说明:ads 这是一个要显示的广告数组对象,可根据要显示的广告内容进行设定相关信息广告内容参数:targetUrl:点击广告转向的页面链接imgUrl:广告显示的图片或者flash地址isflash:广告是否是flash,true表示为flash广告,默认为false图片广告position:广告显示的屏幕位置,分left和right,即显示在屏幕左或者右margin:广告距屏幕两侧的距离,若position为right,则距屏幕右侧距离,position为left,则为距左侧的距离top:广告距屏幕顶部的距离,默认为200pxshowclose:是否在广告上方显示关闭按钮-作者:刘伟neijlwgmail.com日期:2010-01-10-示例:var param=targetUrl:http:/www.week08.com,imgUrl:http:/www.week08.com/flash/galileo.swf,isflash:true,position:left,showclose:true,targetUrl:http:/www.week08.com,imgUrl:http:/logo.week08.com/ys000/lg792/coas_06453554.jpg,isflash:false,position:right,showclose:true;$(document).ready(function()$.adv.showAd(param););*/(function($)$.extend(adv:show:function(ads) this.adFlagId=new Date().getTime();if (!ads|ads.length1) return;var th=this;function makeAd(ad) var str=);if (ad.showclose)str.push();str.push();if (ad.isflash) str.push(); else str.push();str.push();str.push();return str.join();for (var i=0;iads.length;i+)$(document.body).append(makeAd(adsi);var tmpt=0;if (window.innerHeight)tmpt = window.pageYOffset; else if (document.documentElement & document.documentElement.scrollTop) tmpt = document.documentElement.scrollTop;else if (document.body) tmpt = document.body.scrollTop;this.oldFloatAdTop=tmpt+200;setInterval(function()th.scroll();,5);,scroll:function() var o=$(divid=ad:visible);if (o.length1) return;var pos=o.offset();var tmpt=0;if (window.innerHeight)tmpt = window.pageYOffset; else if (document.documentElement & document.documentElement.scrollTop) tmpt = document.documentElement.scrollTop; else if (document.body) tmpt = document.body.scrollTop;var step=20;var topMarg=200;if(pos.topstep) this.oldFloatAdTop+=step;o.css(margin-top,(this.oldFloatAdTop)+px); else if (pos.toptmpt+topMarg)if (Math.abs(pos.top-tmpt-topMarg)step) this.oldFloatAdTop-=step;o.css(margin-top,(this.oldFloatAdTop)+px););)(jQuery);
收藏 下载该资源
网站客服QQ:2055934822
金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号