Jump to content

Bit of a hand please?


GetReady

Recommended Posts

Hey i basically use the following on a html website skin i have with an auto refresh function, is it possible to make the auto refresh stop once a link is clicked; code below

 

   1. <html>   
   2.   <head>  
   3.     <script>  
   4.       var asdf = false;  
   5.       function StartTime(){  
   6.         if(asdf)clearTimeout(asdf)  
   7.         asdf = setTimeout("RefreshPage()",5000);  
   8.       }  
   9.       function RefreshPage(){  
  10. clearTimeout(asdf)  
  11.         if(document.Test.CB1.checked)  
  12.           document.location.href= "timerRefresh.htm?Checked"  
  13.       }  
  14.       function LoadPage(){  
  15.         var findCheck = document.location.href.split("?Chec");  
  16.         if(findCheck.length == 2){  
  17.           document.Test.CB1.checked=true;  
  18.           StartTime()  
  19.         }  
  20.       }  
  21.     </script>  
  22.   </head>  
  23.   <body onload="LoadPage()">  
  24.     <form name="Test">  
  25.       <input type="checkbox" name="CB1" onclick="StartTime()">  
  26.     </form>  
  27.   </body>  
  28. </html>  

Link to comment
https://forums.phpfreaks.com/topic/206660-bit-of-a-hand-please/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

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.