Guest User

Untitled

a guest
Aug 11th, 2015
227
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var czasy = [43,];
  2.         var dalej = false;
  3.         var secs;
  4.         var timerID = null;
  5.         var timerRunning = false;
  6.         var delay = 1000;
  7.         var obecnie = 0;
  8.         var cwicz = 0;
  9.         var typy = new Array();
  10.        
  11.         function InitializeTimer(s)
  12.         {
  13.             // Set the length of the timer, in seconds
  14.             $('#btnDalej').attr('disabled', 'disabled');
  15.             secs = s;
  16.             StopTheClock();
  17.             StartTheTimer();
  18.         }
  19.        
  20.         function StopTheClock()
  21.         {
  22.             if(timerRunning)
  23.             {
  24.                 clearTimeout(timerID);
  25.             }
  26.             timerRunning = false;
  27.         }
  28.        
  29.         function StartTheTimer()
  30.         {
  31.             if (secs == 0)
  32.             {
  33.                 StopTheClock();
  34.                 $('#btnDalej').removeAttr('disabled');
  35.             }
  36.             else
  37.             {
  38.                 self.status = secs;
  39.                 secs = secs - 1;
  40.                 timerRunning = true;
  41.                 timerID = self.setTimeout("StartTheTimer()", delay);
  42.             }
  43.         }
  44.  
  45.     </script>
Advertisement
Add Comment
Please, Sign In to add comment