本帖最后由 txxg 于 2014-7-1 14:19 编辑
1.在<head>区域插入以下代码 <script language=JavaScript>
<!-- // BannerAD var bannerAD=new Array();
var bannerADlink=new Array();
var adNum=0; bannerAD[0]="images/xxlha/DSC00393.JPG";
bannerADlink[0]="images/xxlha/DSC00393.JPG";
bannerAD[1]="images/xxlha/DSC00703.JPG";
bannerADlink[1]="images/xxlha/DSC00703.JPG";
bannerAD[2]="images/xxlha/DSC00228.JPG";
bannerADlink[2]="images/xxlha/DSC00228.JPG";
bannerAD[3]="images/xxlha/DSC00393.JPG";
bannerADlink[3]="images/xxlha/DSC00393.JPG";
bannerAD[4]="images/xxlha/DSC00372.JPG";
bannerADlink[4]="images/xxlha/DSC00372.JPG";
var preloadedimages=new Array(); for (i=1;i<bannerAD.length;i++){
preloadedimages=new Image();
preloadedimages.src=bannerAD;
} function setTransition(){
if (document.all){
bannerADrotator.filters.revealTrans.Transition=Math.floor(Math.random()*23);
bannerADrotator.filters.revealTrans.apply();
}
} function playTransition(){
if (document.all)
bannerADrotator.filters.revealTrans.play()
} function nextAd(){
if(adNum<bannerAD.length-1)adNum++ ;
else adNum=0;
setTransition();
document.images.bannerADrotator.src=bannerAD[adNum];
playTransition();
theTimer=setTimeout("nextAd()", 5000);
} function jump2url(){
jumpUrl=bannerADlink[adNum];
jumpTarget='_blank';
if (jumpUrl != ''){
if (jumpTarget != '')window.open(jumpUrl,jumpTarget);
else location.href=jumpUrl;
}
}
function displayStatusMsg() {
status=bannerADlink[adNum];
document.returnValue = true;
} //-->
</script> 2.把以下代码插入表格 <td><A href="javascript:jump2url()"><IMG src="images/xxlha/DSC00393.JPG"name=bannerADrotator width=550 height=412 border=0 align="absmiddle" style="FILTER: revealTrans(duration=2,transition=20)";></A>
<SCRIPT language=JavaScript>nextAd()</SCRIPT></td> 向老师求助如何把这段代码变成随机显示的。 |