magicadmin Posted August 7, 2006 Share Posted August 7, 2006 Hi all,I'm trying to restart the countdown when the refresh part of the script works...refresh part... function refreshgraffiti() { rfsh = new Date(); rfsh = "?"+rfsh.getTime() document.images["graffitiwall"].src = "<?php echo $graffiti_image; ?>?"+rfsh setTimeout("refreshgraffiti()", 20*1000) display()} Countdown part... <form name="countdown" action=""><input type="text" size="1" name="CountDown" title="Time Till Next Auto Wall Reload" alt="Time Till Next Auto Wall Reload" /></form> <script type="text/javascript"> var milisec=0 var seconds=20 document.countdown.CountDown.value='0.0' function display(){ if (milisec<=0){ milisec=9 seconds-=1 } if (seconds<=-1){ milisec=0 seconds+=1 } else milisec-=1 document.countdown.CountDown.value=seconds+"."+milisec setTimeout("display()",100) } </script> What am i miss here ?? a little lost with it....Thanks Link to comment Share on other sites More sharing options...
joecoolaug Posted August 14, 2006 Share Posted August 14, 2006 Could you please explain in detail what you're trying to do. That would help a lot. Link to comment Share on other sites More sharing options...
joecoolaug Posted August 15, 2006 Share Posted August 15, 2006 It would also be helpful if you gave me the URL to the site. Link to comment Share on other sites More sharing options...
Skemcin Posted August 15, 2006 Share Posted August 15, 2006 try this <script language="javascript" type="javascript/text">var seconds=7100;function countDown() { if(seconds<=0) { document.location.href="xxxxxx.xxx"; } seconds--; window.setTimeout("countDown()",1000); }function resetCounter() { seconds=7100;}<script> where 7100 equals the number of seconds you want to count downwith this in the body tag: <body onLoad="countDown()" onchange="resetCounter()" onmousemove="resetCounter()" onclick="resetCounter()" onscroll="resetCounter()"> Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now