交替播放图片广告

<SCRIPT LANGUAGE="JavaScript">
<!--
var imgUrl=new Array();//创建图片路径数组
var imgLink=new Array();//创建图片超链接地址数组
var adNum=0;
imgUrl[1]="http://www.blogchina.com/skin/suit02/images/site/blogchinahomepage_logo.gif";
imgLink[1]="http://blogchina.com/";
imgUrl[2]="http://www.onlinedown.net/images/huajunlogo.gif";
imgLink[2]="http://www.onlinedown.net/Index.htm";
imgUrl[3]="http://csdn.net/Images/logo_csdn.gif";
imgLink[3]="http://csdn.net/";
imgUrl[4]="";
imgLink[4]="";
imgUrl[5]="";
imgLink[5]="";

var imgPre=new Array();
var j=0;
for (i=1;i<=5;i++) {
if( (imgUrl[i]!="") && (imgLink[i]!="") ) {
j++;
} else {
break;
}
}

function playTran(){
if (document.all)
imgInit.filters.revealTrans.play();
}

var key=0;
function nextAd(){
if(adNum<j)adNum++ ;
else adNum=1;

if( key==0 ){
key=1;
} else if (document.all){
imgInit.filters.revealTrans.Transition=6;
imgInit.filters.revealTrans.apply();
playTran();

}
document.images.imgInit.src=imgUrl[adNum];
theTimer=setTimeout("nextAd()", 6000);
}

function goUrl(){
jumpUrl=imgLink[adNum];
jumpTarget='_blank';
if (jumpUrl != ''){
if (jumpTarget != '')
window.open(jumpUrl,jumpTarget);
else
location.href=jumpUrl;
}
}
//-->
</SCRIPT>
<a href="javascript:goUrl()"><img style="FILTER: revealTrans(duration=2,transition=20);border-color:black;color:#000000" src="javascript:nextAd()" border=1 name=imgInit></a>

你可能感兴趣的:(JavaScript,.net,J#)