Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    Registered User
    Join Date
    Dec 2004
    Posts
    37
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Adding setTimeout - HELP

    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:



    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>

  • #2
    Regular Coder
    Join Date
    May 2005
    Posts
    100
    Thanks
    0
    Thanked 0 Times in 0 Posts
    try the setInterval() function

  • #3
    Registered User
    Join Date
    Dec 2004
    Posts
    37
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I am not good at coding. Can you please tell me where and how to implement it. Thanks.

  • #4
    Regular Coder
    Join Date
    May 2005
    Posts
    100
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by ebay258
    I am not good at coding. Can you please tell me where and how to implement it. Thanks.
    www.google.com


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •