|
<SPAN style="FONT-SIZE: 12px" twffan="done"><B>效果演示:<BR><A href="http://www.netbei.com/demo/html/ad_lh/test.html" target=_blank><FONT color=#003366>http://www.netbei ... h/test.html</FONT></A><BR></B><BR><BR><BR><BR><BR><BR><BR>&lt;script LANGUAGE="java script"&gt;<BR>&lt;!--<BR>var cpAD=new Array(); <BR>var cpADlink=new Array(); <BR>var cpADmsg=new Array(); <BR>//定义了5个数组<BR>var adNum=5; <BR>var coll=0;<BR><BR>//ad/1.html 那时你链接的广告地址<BR><BR>cpAD[0]="banners/mba.gif"; <BR>cpADlink[0]="ad/1.html"; <BR>cpADmsg[0]="1"; <BR><BR>cpAD[1]="banners/google.gif"; <BR>cpADlink[1]="ad/2.html"<BR>cpADmsg[1]="2"; <BR><BR>cpAD[2]="banners/2005.gif"; <BR>cpADlink[2]="ad/3.html"; <BR>cpADmsg[2]="3";<BR><BR>cpAD[3]="banners/cz8y.gif"; <BR>cpADlink[3]="ad/4.html"; <BR>cpADmsg[3]="4"; <BR><BR>cpAD[4]="banners/JG_YUEDU.gif"; <BR>cpADlink[4]="ad/5.html"; <BR>cpADmsg[4]="5"; <BR><BR>var preloadedimages=new Array(); <BR>for (i=1;i&lt;cpAD.length;i ){ <BR>preloadedimages=new Image(); <BR>preloadedimages.src=cpAD; <BR>} <BR><BR>//跳转的URL地址<BR>function jump2url()<BR>{ <BR>jumpUrl=cpADlink[adNum]; <BR>jumpTarget='_blank'; <BR>if (jumpUrl != '')<BR>{ <BR> if (jumpTarget != '')<BR> window.open(jumpUrl,jumpTarget); <BR> else location.href=jumpUrl; <BR> } <BR>}<BR><BR>//图片变化的函数<BR>function changeimg(n)<BR>{<BR> adNum=n;<BR> switch(adNum)<BR> {<BR> case 0:<BR> {<BR> window.img1.src="banners/1-2.gif";<BR> window.img2.src="banners/2.gif";<BR> window.img3.src="banners/3.gif";<BR> window.img4.src="banners/4.gif";<BR> window.img5.src="banners/5.gif";<BR> break;<BR> }<BR> case 1:<BR> {<BR> window.img1.src="banners/1.gif";<BR> window.img2.src="banners/2-2.gif";<BR> window.img3.src="banners/3.gif";<BR> window.img4.src="banners/4.gif";<BR> window.img5.src="banners/5.gif";<BR> break;<BR> }<BR> case 2:<BR> {<BR> window.img1.src="banners/1.gif";<BR> window.img2.src="banners/2.gif";<BR> window.img3.src="banners/3-2.gif";<BR> window.img4.src="banners/4.gif";<BR> window.img5.src="banners/5.gif";<BR> break;<BR> }<BR> case 3:<BR> {<BR> window.img1.src="banners/1.gif";<BR> window.img2.src="banners/2.gif";<BR> window.img3.src="banners/3.gif";<BR> window.img4.src="banners/4-2.gif";<BR> window.img5.src="banners/5.gif";<BR> break;<BR> }<BR> case 4:<BR> {<BR> window.img1.src="banners/1.gif";<BR> window.img2.src="banners/2.gif";<BR> window.img3.src="banners/3.gif";<BR> window.img4.src="banners/4.gif";<BR> window.img5.src="banners/5-2.gif";<BR> break;<BR> }<BR> }<BR> window.clearInterval(theTimer);<BR> adNum=adNum-1;<BR> nextAd();<BR>}<BR>//当点击时直接跳转<BR>function nextAd(){ <BR>coll ;<BR>if(coll&gt;1)<BR>{<BR>switch(adNum 1)<BR>{<BR> case 5:<BR> {<BR> window.img1.src="banners/1-2.gif";<BR> window.img2.src="banners/2.gif";<BR> window.img3.src="banners/3.gif";<BR> window.img4.src="banners/4.gif";<BR> window.img5.src="banners/5.gif";<BR> break;<BR> }<BR> case 1:<BR> {<BR> window.img1.src="banners/1.gif";<BR> window.img2.src="banners/2-2.gif";<BR> window.img3.src="banners/3.gif";<BR> window.img4.src="banners/4.gif";<BR> window.img5.src="banners/5.gif";<BR> break;<BR> }<BR> case 2:<BR> {<BR> window.img1.src="banners/1.gif";<BR> window.img2.src="banners/2.gif";<BR> window.img3.src="banners/3-2.gif";<BR> window.img4.src="banners/4.gif";<BR> window.img5.src="banners/5.gif";<BR> break;<BR> }<BR> case 3:<BR> {<BR> window.img1.src="banners/1.gif";<BR> window.img2.src="banners/2.gif";<BR> window.img3.src="banners/3.gif";<BR> window.img4.src="banners/4-2.gif";<BR> window.img5.src="banners/5.gif";<BR> break;<BR> }<BR> case 4:<BR> {<BR> window.img1.src="banners/1.gif";<BR> window.img2.src="banners/2.gif";<BR> window.img3.src="banners/3.gif";<BR> window.img4.src="banners/4.gif";<BR> window.img5.src="banners/5-2.gif";<BR> break;<BR> }<BR>}<BR>}<BR>if(adNum&lt;cpAD.length-1)adNum ; <BR>else adNum=0; <BR>setTransition(); <BR>document.images.cpADrush.src=cpAD[adNum]; <BR>playTransition(); <BR>displayStatusMsg();<BR>//定义了轮换时间 5s<BR>theTimer=setTimeout("nextAd()", 5000); <BR>} <BR><BR>function setTransition(){ <BR>if (document.all){ <BR>cpADrush.filters.revealTrans.Transition=23; <BR>cpADrush.filters.revealTrans.apply(); <BR>} <BR><BR>} <BR>function playTransition(){ <BR>if (document.all) <BR>cpADrush.filters.revealTrans.play() <BR>} <BR>function displayStatusMsg() { <BR>status=cpADmsg[adNum]; <BR>document.returnValue = true; <BR>} <BR>//结束<BR>// --&gt;<BR><BR>&lt;/script&gt;<BR><BR><BR><BR>&lt;table height="148" cellspacing="0" cellpadding="0"&gt;<BR> &lt;tr&gt; <BR> &lt;td&gt; &lt;a href="java script:jump2url()"&gt; &lt;img style="FILTER: revealTrans(duration=2,transition=23)" height="150" src width="575" border="0" name="cpADrush"&gt;&lt;/a&gt;&lt;/td&gt;<BR> &lt;script language="java script"&gt;nextAd()&lt;/script&gt;<BR> &lt;/tr&gt;<BR> &lt;tr&gt; <BR> &lt;td&gt; <BR> &lt;table width="575" name="T1" id="T1" border="0" cellspacing="1" cellpadding="0"&gt;<BR> &lt;tr&gt; <BR> &lt;td align="right"&gt;&lt;img src="banners/dh_bg.gif" width="178" height="16"&gt;&lt;/td&gt;<BR> &lt;td width="20"&gt;&lt;a href="#" &gt;&lt;img name="Image2" id="img1" border="0" src="banners/1.gif" width="20" height="16" &gt;&lt;/a&gt;&lt;/td&gt;<BR> &lt;td width="20"&gt;&lt;a href="#" &gt;&lt;img name="Image3" id="img2" border="0" src="banners/2.gif" width="20" height="16" &gt;&lt;/a&gt;&lt;/td&gt;<BR> &lt;td width="20"&gt;&lt;a href="#" &gt;&lt;img name="Image4" id="img3" border="0" src="banners/3.gif" width="20" height="16" &gt;&lt;/a&gt;&lt;/td&gt;<BR> &lt;td width="20"&gt;&lt;a href="#" &gt;&lt;img name="Image5" id="img4" border="0" src="banners/4.gif" width="20" height="16" &gt;&lt;/a&gt;&lt;/td&gt;<BR> &lt;td width="20"&gt;&lt;a href="#" &gt;&lt;img name="Image6" id="img5" border="0" src="banners/5.gif" width="20" height="16" &gt;&lt;/a&gt;&lt;/td&gt;<BR> &lt;/tr&gt;<BR> &lt;/table&gt;<BR> &lt;/td&gt;<BR> &lt;/tr&gt;<BR> &lt;/table&gt;<BR><BR></SPAN> |
|