Advertisement
Guest User

Untitled

a guest
Jun 19th, 2017
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <script type="text/javascript">
  2. //this sets the timer with the current time setting if the user hasn't moved
  3. //their mouse in 5 seconds (1000 = 1second) then it will refresh to the main page
  4. window.onload = function () {
  5.     //refreshy = setTimeout("window.location='main.php'", 1800000);
  6.     refreshy = setTimeout("window.location='main.php'", 10000);
  7. }
  8. // every time the mouse is moved the timer resets giving the user more time
  9. // before the page refreshes
  10. window.onmousemove = function(timer, time) {
  11.      clearTimeout(timer);
  12.      timer = setTimeout("window.location='main.php'", time);
  13. }
  14. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement