Welcome Guest ( Log In | Register )



 
Reply to this topicStart new topic
> 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
shiv
post Mar 20 2006, 08:16 PM
Post #1


Member [ Level 2 ]
Group Icon

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.


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
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic

Collapse

> Similar Topics

Topics Topics
  1. IE6 display:block hides other image BUG(1)
  2. How To Display Clear Image On Web Site(4)
  3. All Images Don't Show Up When Published!(7)
  4. Flash Pic Problems(7)
  5. One Of These Browsers Are Not Like The Other(8)
  6. Find Out Dead Links In Your Site Automatically(11)
  7. Help>> Fade Images(1)
  8. Free Links Exchange: Promote & Increase Page Rank(9)
  9. Netscapenav Display Problem << Guru Help Needed(2)
  10. Php: How To Make A Menu With Images ?(6)
  11. Random Images On Eacht Pageload And Refresh.(6)
  12. Applying Css Through Links.(10)
  13. Sounds With Links(6)
  14. How To Display XX Users Online On Your Site ?(5)
  15. Creating Links With Quotes (")(2)


 



- Lo-Fi Version Time is now: 13th October 2008 - 04:23 AM