说明:注意替换图片地址,2.还可以加链接,3.修改数字23可以得到不同的网页图片效果
详细代码:
<SCRIPT language=JavaScript>
var imgUrl=new Array();
var imgLink=new Array();
imgUrl[1]="pic/1.jpg";
imgLink[1]="http:///";
imgUrl[2]="pic/2.jpg";
imgLink[2]="http://";
imgUrl[3]="pic/3.jpg";
imgLink[3]="http://";
imgUrl[4]="pic/4.jpg";
imgLink[4]="http:/";
imgUrl[5]="pic/5.jpg";
imgLink[5]="http:/";
imgUrl[6]="pic/6.jpg";
imgLink[6]="http:/";
imgUrl[7]="pic/7.jpg";
imgLink[7]="http:/";
var adNum=0;
function playTran(){
if (document.all)
imgInit.filters.revealTrans.play();
}
var key=0;
function nextAd(){
adNum=adNum%4;
adNum++ ;
if( key==0 ){
key=1;
} else if (document.all){
imgInit.filters.revealTrans.Transition=23;
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=10);border-color:black;color:#000000" src="javascript:nextAd()" width=166 height=161 border=0 class=img1111 name=imgInit></a>