var imgUrl=new Array(); var imgLink=new Array(); var adNum=0; imgUrl[1]="照片.gif"; imgLink[1]="#"; imgUrl[2]="照片.gif"; imgLink[2]="#"; var imgPre=new Array(); var imgj=0; for (imgi=1;imgi<3;imgi++) { if( (imgUrl[imgi]!="") && (imgLink[imgi]!="") ) { imgj++; } else { break; } } function playTran() { if (document.all) { imgInit.filters[0].Apply(); imgInit.filters[0].Play(duration=2); } } var key=0; function nextAd() { if(adNum<imgj)adNum++ ; else adNum=1; if( key==0 ) { key=1; } else if (document.all) { playTran(); } document.images.imgInit.src=imgUrl[adNum]; theTimer=setTimeout("nextAd()", 4000); } function goUrl() { jumpUrl=imgLink[adNum]; jumpTarget='_blank'; if (jumpUrl != '') { if (jumpTarget != '') window.open(jumpUrl,jumpTarget); else location.href=jumpUrl; } }
--------------------------- <SCRIPT language=Javascript> var bannerAD=new Array(); var bannerADlink=new Array(); var bannerADtarget=new Array(); var adNum=0; <!-- 图像1 --> bannerAD[1]="http://www.mjj.com/1.gif"; <!-- 图像2 --> bannerAD[2]="http://www.mjj.com/2.gif"; <!-- 图像3 --> bannerAD[3]="http://www.mjj.com/3.gif"; <!-- 图像4 --> bannerAD[4]="http://www.mjj.com/4.gif"; <!-- 图像5 --> bannerAD[5]="http://www.mjj.com/5.gif"; <!-- 图像可加 --> var preloadedimages=new Array(); for (i=1;i<bannerAD.length-1;i++){ preloadedimages=new Image(); preloadedimages.src=bannerAD; } function setTransition(){ if (document.all){ bannerADrotator.filters.revealTrans.Transition=12; bannerADrotator.filters.revealTrans.apply(); } } function playTransition(){ if (document.all) bannerADrotator.filters.revealTrans.play() } function nextAd(){ if(adNum<bannerAD.length-1)adNum++ ; else adNum=1; setTransition(); document.images.bannerADrotator.src=bannerAD[adNum]; playTransition(); theTimer=setTimeout("nextAd()", 3800); } function jump2url(){ jumpUrl=bannerADlink[adNum]; jumpTarget=bannerADtarget[adNum]; if (jumpUrl != ''){ if (jumpTarget != '')window.open(jumpUrl,jumpTarget); else window.open(jumpUrl,"","toolbar=yes,location=yes,directories=yes,status=yes,scrollbars=yes,resizable=yes"); } } function displayStatusMsg() { status=bannerADlink[adNum]; document.returnValue = true; } </SCRIPT> --------------------------- 以下加入到<Body>之间 ---------------------------- <IMG style="FILTER: revealTrans(duration=1,transition=12)" height=189 src="http://www.mjj.com/1.gif" ... 0name=bannerADrotator> <SCRIPT language=JavaScript>nextAd()</SCRIPT>
再来一个 <BODY onload=AlphaBar();> <SCRIPT> var IE5=null; if(navigator.userAgent.indexOf("IE 5.0")>-1) IE5=true; else IE5=false; function ImgTrans() { if(IE5==false) { var Filter=new Array( "progidXImageTransform.Microsoft.Fade(Duration=1)",//变化样式 "progidXImageTransform.Microsoft.Wipe(Duration=2 , GradientSize=1.0, wipeStyle=0, motion='forward')", "progidXImageTransform.Microsoft.Wipe(Duration=2 , GradientSize=1.0, wipeStyle=0, motion='reverse')", "progidXImageTransform.Microsoft.Pixelate(Duration=1 , MaxSquare=25)" ) var FilterIndex=Math.ceil(Math.random()*1000)%Filter.length; imgObj.style.filter=Filter[FilterIndex]; imgObj.filters[0].apply(); imgObj.src = imgSwapObj.src; imgObj.filters[0].play(); } else { imgObj.style.filter="revealtrans(duration=1,transition=23)"; imgObj.filters[0].transition=23; imgObj.filters[0].apply(); imgObj.src = imgSwapObj.src; imgObj.filters[0].play(); } } </SCRIPT> <SCRIPT>AlphaBarImage=new Array(6); AlphaBarLink=new Array(6); AlphaBarImage[0]="1.jpg"; AlphaBarLink[0]="1111111.htm"; AlphaBarImage[1]="2.jpg"; AlphaBarLink[1]="1111111.htm"; AlphaBarImage[2]="3.jpg"; AlphaBarLink[2]="1111111.htm"; AlphaBarImage[3]="4.jpg"; AlphaBarLink[3]="1111111.htm"; AlphaBarImage[4]="5.jpg"; AlphaBarLink[4]="1111111.htm"; AlphaBarImage[5]="6.jpg"; AlphaBarLink[5]="1111111.htm"; </SCRIPT> <SCRIPT> var AlphaBarIndex=0; function AlphaBar() { imgSwapObj.src="images/"+AlphaBarImage[AlphaBarIndex];//-------设定路径 AlphaBarLinkHref.href=AlphaBarLink[AlphaBarIndex]; ImgTrans(); AlphaBarIndex++; if (AlphaBarIndex%6==0)AlphaBarIndex=0;//-------------------------图片循环 setTimeout("AlphaBar()",4000);//------------------变换间隔时间 } </SCRIPT> <A id=AlphaBarLinkHref href=""> <IMG id=imgObj height=100 src="images/1.jpg" width=568 galleryImg="no"> </A> <IMG id=imgSwapObj height=0 src="" width=0> </BODY>