WEB开发网
开发学院网页设计JavaScript 两个强制点击广告后才能下载的代码 阅读

两个强制点击广告后才能下载的代码

 2009-04-22 20:04:55 来源:WEB开发网   
核心提示:<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmln

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>中国站长天空-网页特效-综合特效-强制点击广告代码(一)</title>
<meta http-equiv="content-type" content="text/html;charset=gb2312">
<!--把下面代码加到<head>与</head>之间-->
<script language="javascript">
var num = 2;
var mypage = 'http://www.XXXX.cn';
var pissoff = '请先点击上面的链接!';
allow = Array();
allow[num] = 2;
function gotoit(link){
if (link != num){
allow[link] = 2;
} else {
for (i=1;i<=num;i++){
if (allow[i] != 2){
i = num + 1;
lemmeIn = 0;
} else {
lemmeIn = 1;
}
}
if (lemmeIn == 1){
window.location = mypage;
} else {
alert(pissoff);
}
}
}
//--->
</script>
</head>
<body>
<!--把下面代码加到<body>与</body>之间-->
<a href="http://www.XXX.cn" target="_blank" >广告链接</a><br>
<a href="Javascript:gotoit(num)">请先点击上面的链接再点击这里下载</a>
</body>
</html>


 程序代码

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>中国站长天空-网页特效-综合特效-强制点击广告代码(二)</title>
<meta http-equiv="content-type" content="text/html;charset=gb2312">
<!--把下面代码加到<head>与</head>之间-->
<script language="javascript">
<!--
function MM_showHideLayers() {//v2.0
var i, visStr, args, theObj;
args = MM_showHideLayers.arguments;
for (i=0; i<(args.length-2); i+=3) {//with arg triples (objNS,objIE,visStr)
visStr = args[i+2];
if (navigator.appName == 'Netscape' && document.layers != null) {
theObj = eval(args[i]);
if (theObj) theObj.visibility = visStr;
} else if (document.all != null) {//IE
if (visStr == 'show') visStr = 'visible';//convert vals
if (visStr == 'hide') visStr = 'hidden';
theObj = eval(args[i+1]);
if (theObj) theObj.style.visibility = visStr;
} }
}
function MM_PReloadImages() {//v2.0
if (document.images) {
var imgFiles = MM_preloadImages.arguments;
if (document.preloadArray==null) document.preloadArray = new Array();
var i = document.preloadArray.length;
with (document) for (var j=0; j<imgFiles.length; j++) if (imgFiles[j].charAt(0)!="#"){
preloadArray[i] = new Image;
preloadArray[i++].src = imgFiles[j];
} }
}
//-->
</script>
</head>
<body>
<!--把下面代码加到<body>与</body>之间-->
<div id="Layer1" style="position:absolute;top:75px;left:10px;width:306px;height:63px;z-index:1;visibility:hidden;"><a href="http://www.XXX.cn">下载</a></div>
<div id="Layer2" style="position:absolute;top:10px;left:10px;width:147px;height:82px;z-index:2;visibility: visible;"><a href="http://www.XXX.cn" target="_blank"><img src="http://www.XXX.cn/effect/images/234×60.gif" border="0" ></a></div>
</body>
</html>

Tags:两个 强制 点击

编辑录入:爽爽 [复制链接] [打 印]
赞助商链接