...

View Full Version : Adding setTimeout - HELP



ebay258
05-22-2005, 10:36 PM
Hi,

I got this code that's supposed to be a banner rotator but it only rotates on every page visit. i want it to rotate the banner by a speciffic interval of minutes. I'm guessing it has something to do with the setTimeout method but I'm a newbie.

Thanks in adavance.

Here's the code:




<script language="JavaScript">
rnd.today=new Date();
rnd.seed=rnd.today.getTime();

function rnd()
{
rnd.seed = (rnd.seed*9301+49297) % 233280;
return rnd.seed/(233280.0);
};

function rand(number)
{
return Math.ceil(rnd()*number);
};

var number=rand(2)-1



if (number == 0) {
document.write("<div align=center><a href=<!--Link here--> target=_blank>")
document.write("<img src=<!--image here--> alt=\"<!--Alt Tag here-->\" border=0></a></div>")
}


if (number == 1) {
document.write("<div align=center><a href=<!--Link here--> target=_blank>")
document.write("<img src=<!--image here--> alt=\"<!--Alt Tag here-->\" border=0></a></div>")
}



</script>

CrAzY_J
05-22-2005, 10:52 PM
try the setInterval() function

ebay258
05-22-2005, 11:02 PM
I am not good at coding. Can you please tell me where and how to implement it. Thanks.

CrAzY_J
05-23-2005, 12:46 AM
I am not good at coding. Can you please tell me where and how to implement it. Thanks.
www.google.com



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum