除了图片进行轮流转换外,相应的文字也随之进行变化
<head> <script language=JavaScript> //more javascript from http://www.itjxue.com var imgUrl=new Array(); var imgLink=new Array(); var imgTz=new Array(); var adNum=0; imgUrl[1]="http://www.itjxue.com/img/200406301.jpg"; imgLink[1]="http://www.itjxue.com"; imgTz[1]="<a href=#><font color=white>文字链接内容一</font></a>"; imgUrl[2]="http://www.itjxue.com/img/200406302.jpg"; imgLink[2]="http://www.itjxue.com"; imgTz[2]="<a href=#><font color=white>文字链接内容二</font></a>"; imgUrl[3]="http://www.itjxue.com/img/200406303.jpg"; imgLink[3]="http://www.itjxue.com"; imgTz[3]="<a href=#><font color=white>文字链接内容三</font></a>"; var j=0; for (i=1;i<=3;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]; document.getElementById('jdtz').innerHTML=imgTz[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> </head> <body> <table><tr><td> <a href="javascript:goUrl()"><img style="FILTER: revealTrans(duration=2,transition=20); border=0" src="javascript:nextAd()" width=150 height=100 border=0 name=imgInit></a> </td></tr><tr><td id=jdtz bgcolor="blue"></td></tr></table> </body>
[Ctrl+A 全部选择 提示:你可先修改部分代码,再按运行]