|
|
|
|
![]() ![]() |
Mar 20 2006, 08:16 PM
Post
#1
|
|
|
Member [ Level 2 ] Group: Members Posts: 53 Joined: 20-March 06 Member No.: 12,139 |
hai this is my first post and i really hope someone finds it useful.
i was looking for this trick for long and finally found out today... to rotate images in your page automatically in a sequence without having to refresh the page. i find it particualry useful to highlight on the home page the various contents inside my site. Notice from szupie:
QUOTE Step 1: place the code below between the < BODY > and tags within the HTML page where you want the random banners to appear. CODE <ilayer id="l1"> <layer id="l2"> <div id="l1"> <div id="l3" style="position:relative"> </div> </div> </layer> </ilayer> Step 2: place this code below the above code. the best place would be right before the tag. CODE <script language="JavaScript"> <!-- var bannerArray = new Array(); var myCount=0; // Banner Code Assignment bannerArray[0] = "<A HREF=\"http://your link here\"><IMG SRC=\"http://image 1 path link here\" border=\"0\" width=\"468\" height=\"60\"></A>"; bannerArray[1] = "<A HREF=\"http://your link here\"><IMG SRC=\"http://image 2 path link here\" border=\"0\" width=\"468\" height=\"60\"></A>"; bannerArray[2] = "<A HREF=\"http://your link here"><IMG SRC=\"http://image 3 path link here" border=\"0\" width=\"468\" height=\"60\"></A>"; bannerRotate(); function bannerRotate() { if(myCount > bannerArray.length-1){myCount=0;} // Write out rotation if (document.all){ // it is IE document.all.l3.innerHTML=bannerArray[myCount]; } else if (document.layers){ // it is NN document.layers.l1.document.layers.l2.document.open(); document.layers.l1.document.layers.l2.document.write(bannerArray[myCount]); document.layers.l1.document.layers.l2.document.close(); } setTimeout("bannerRotate()", 3000); myCount++; } // --> </script> cheers! shiv |
|
|
|
![]() ![]() |
Similar Topics
|
Lo-Fi Version | Time is now: 13th October 2008 - 04:23 AM |