|
点击下载地址链接 弹出页面实现代码,可以用来弹出广告商的广告。
复制代码 代码如下: <A onclick=checkopen(this); href="//www.jb51.net" target=_blank>打开下载页面1</A> <script> <!-- var original_url = "" var adurl = new Array(9); var isclick = false; var adurl_i = 5; adurl[0] = "//www.jb51.net"; adurl[1] = "http://www.yuanma51.com/"; adurl[2] = "http://www.baidu.com/";
function selectFrom(iFirstValue,iLastValue){ var iChoces = Math.abs(iLastValue - iFirstValue) + 1; return Math.floor(Math.random() * iChoces + iFirstValue); }
adurl_i = selectFrom(0,2);
function checkopen(a){ if(adurl_i<9){ if(isclick==false){ original_url = a.href; a.href = adurl[adurl_i]; isclick = true; top.location.href = original_url; }else{ a.href = original_url; } } } //--> </script>
|
|