Tricky Tricks ›› Programming Tricks ›› Javascript Tricks ›› Rotating Banners Simple Rotation

Rotating Banners Simple Rotation

Javascript Tricks

Rotating Banners-Simple Rotation:

Simple Rotation This is an excellent script if you want to show 3 or more low K banners in the same spot. Just replace the banner1, banner2, etc. with your banner name files.

 ><TITLE>Banners</TITLE>
 <SCRIPT LANGUAGE=JAVASCRIPT>
         <!-- Hide script from old browsers                
         var adImages = new Array("banner1.gif","banner2.gif","banner3.gif")        
         var thisAd = 0        
         var imgCt = 3                
         function cycle() {                
         	if (document.images) {                        
         	thisAd++                        
         	if (thisAd == imgCt) {                                
         	thisAd = 0                        
        }                        
        document.adBanner.src=adImages[thisAd]                        
        setTimeout("cycle()", 3 * 1000)                
        }        }                
        // End hiding script from old browsers --> 
 </SCRIPT>
 
 <CENTER><IMG SRC="banner1.gif" WIDTH="400" HEIGHT="75" NAME="adBanner"></CENTER>
 

Partners