Javascript| Advertising
Demo effect:http://www.webjx.com/htmldata/2005-11-26/test.html
<script language= "JavaScript" >
<!--
var cpad=new Array ();
var cpadlink=new Array ();
var cpadmsg=new Array ();
5 Arrays defined
var adnum=5;
var coll=0;
Ad/1.html at that time you linked the ad address
Cpad[0]= "Banners/mba.gif";
Cpadlink[0]= "ad/1.html";
cpadmsg[0]= "1";
Cpad[1]= "Banners/google.gif";
cpadlink[1]= "Ad/2.html"
cpadmsg[1]= "2";
Cpad[2]= "Banners/2005.gif";
Cpadlink[2]= "ad/3.html";
cpadmsg[2]= "3";
Cpad[3]= "Banners/cz8y.gif";
Cpadlink[3]= "ad/4.html";
Cpadmsg[3]= "4";
Cpad[4]= "Banners/jg_yuedu.gif";
Cpadlink[4]= "ad/5.html";
cpadmsg[4]= "5";
var preloadedimages=new Array ();
for (i=1;i<cpad.length;i++) {
Preloadedimages[i]=new Image ();
Preloadedimages[i].src=cpad[i];
}
The URL address of the jump
function Jump2url ()
{
Jumpurl=cpadlink[adnum];
jumptarget= ' _blank ';
if (Jumpurl!= ')
{
if (Jumptarget!= ')
window.open (Jumpurl,jumptarget);
else Location.href=jumpurl;
}
}
Function of a picture change
function changeimg (n)
{
Adnum=n;
Switch (adnum)
{
Case 0:
{
Window.img1.src= "/uploadpic/2007-7/20077717158750.gif";
Window.img2.src= "/uploadpic/2007-7/20077717159630.gif";
Window.img3.src= "/uploadpic/2007-7/20077717159771.gif";
Window.img4.src= "4.gif";
Window.img5.src= "/uploadpic/2007-7/20077717159962.gif";
Break
}
Case 1:
{
Window.img1.src= "/uploadpic/2007-7/20077717159287.gif";
Window.img2.src= "/uploadpic/2007-7/20077717159359.gif";
Window.img3.src= "/uploadpic/2007-7/20077717159771.gif";
Window.img4.src= "4.gif";
Window.img5.src= "/uploadpic/2007-7/20077717159962.gif";
Break
}
Case 2:
{
Window.img1.src= "/uploadpic/2007-7/20077717159287.gif";
Window.img2.src= "/uploadpic/2007-7/20077717159630.gif";
Window.img3.src= "/uploadpic/2007-7/20077717159990.gif";
Window.img4.src= "4.gif";
Window.img5.src= "/uploadpic/2007-7/20077717159962.gif";
Break
}
Case 3:
{
Window.img1.src= "/uploadpic/2007-7/20077717159287.gif";
Window.img2.src= "/uploadpic/2007-7/20077717159630.gif";
Window.img3.src= "/uploadpic/2007-7/20077717159771.gif";
Window.img4.src= "/uploadpic/2007-7/20077717159187.gif";
Window.img5.src= "/uploadpic/2007-7/20077717159962.gif";
Break
}
Case 4:
{
Window.img1.src= "/uploadpic/2007-7/20077717159287.gif";
Window.img2.src= "/uploadpic/2007-7/20077717159630.gif";
Window.img3.src= "/uploadpic/2007-7/20077717159771.gif";
Window.img4.src= "4.gif";
Window.img5.src= "/uploadpic/2007-7/20077717159913.gif";
Break
}
}
Window.clearinterval (Thetimer);
Adnum=adnum-1;
Nextad ();
}
Jump directly when clicked
function Nextad () {
coll++;
if (coll>1)
{
Switch (adnum+1)
{
Case 5:
{
Window.img1.src= "/uploadpic/2007-7/20077717158750.gif";
Window.img2.src= "/uploadpic/2007-7/20077717159630.gif";
Window.img3.src= "/uploadpic/2007-7/20077717159771.gif";
Window.img4.src= "4.gif";
Window.img5.src= "/uploadpic/2007-7/20077717159962.gif";
Break
}
Case 1:
{
Window.img1.src= "/uploadpic/2007-7/20077717159287.gif";
Window.img2.src= "/uploadpic/2007-7/20077717159359.gif";
Window.img3.src= "/uploadpic/2007-7/20077717159771.gif";
Window.img4.src= "4.gif";
Window.img5.src= "/uploadpic/2007-7/20077717159962.gif";
Break
}
Case 2:
{
Window.img1.src= "/uploadpic/2007-7/20077717159287.gif";
Window.img2.src= "/uploadpic/2007-7/20077717159630.gif";
Window.img3.src= "/uploadpic/2007-7/20077717159990.gif";
Window.img4.src= "4.gif";
Window.img5.src= "/uploadpic/2007-7/20077717159962.gif";
Break
}
Case 3:
{
Window.img1.src= "/uploadpic/2007-7/20077717159287.gif";
Window.img2.src= "/uploadpic/2007-7/20077717159630.gif";
Window.img3.src= "/uploadpic/2007-7/20077717159771.gif";
Window.img4.src= "/uploadpic/2007-7/20077717159187.gif";
Window.img5.src= "/uploadpic/2007-7/20077717159962.gif";
Break
}
Case 4:
{
Window.img1.src= "/uploadpic/2007-7/20077717159287.gif";
Window.img2.src= "/uploadpic/2007-7/20077717159630.gif";
Window.img3.src= "/uploadpic/2007-7/20077717159771.gif";
Window.img4.src= "4.gif";
Window.img5.src= "/uploadpic/2007-7/20077717159913.gif";
Break
}
}
}
if (adnum<cpad.length-1) adnum++;
else adnum=0;
Settransition ();
Document.images.cpadrush.src=cpad[adnum];
Playtransition ();
Displaystatusmsg ();
5s of rotation time defined
Thetimer=settimeout ("Nextad ()", 5000);
}
function Settransition () {
if (document.all) {
cpadrush.filters.revealtrans.transition=23;
CpADrush.filters.revealTrans.apply ();
}
}
function Playtransition () {
if (document.all)
CpADrush.filters.revealTrans.play ()
}
function Displaystatusmsg () {
Status=cpadmsg[adnum];
Document.returnvalue = true;
}
End
-->
</script>
<table height= "148" cellspacing= "0" cellpadding= "0" >
<tr>
<td> <a href= "Javascript:jump2url ()" > </a></td>
<script language= "JavaScript" >nextad () </script>
</tr>
<tr>
<td>
<table width= "575" name= "T1" id= "T1" border= "0" cellspacing= "1" cellpadding= "0" >
<tr>
<TD align= "right" ></td>"
<TD width= "><a href=" # "></a></td>"
<TD width= "><a href=" # "></a></td>"
<TD width= "><a href=" # "></a></td>"
<TD width= ><a href= "#" ></td>
<TD width= "><a href=" # "></a></td>"
</tr>
</table>
</td>
</tr>
</table>