当前位置:Gxlcms > JavaScript > 点击下载链接 弹出页面实现代码

点击下载链接 弹出页面实现代码

时间:2021-07-01 10:21:17 帮助过:3人阅读

代码如下:
<A
onclick=checkopen(this);
href="//www.gxlcms.com"
target=_blank>打开下载页面1</A>
<script>
<!--
var original_url = ""
var adurl = new Array(9);
var isclick = false;
var adurl_i = 5;
adurl[0] = "//www.gxlcms.com";
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>

人气教程排行