Jump to content
xisto Community
Sign in to follow this  
shiv

To Display Images With Links In A Rotating Sequence Without Refreshing The Page! how to rotate images with links in a sequence automatically without ha

Recommended Posts

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:

Step 1: place the code below between the < BODY > and tags within the HTML page where you want the random banners to appear.

<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.

<script language="JavaScript"><!--var bannerArray = new Array();var myCount=0;// Banner Code AssignmentbannerArray[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

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.