Widget:TimerTest2: Difference between revisions
Jump to navigation
Jump to search
Matt Pijoan (talk | contribs) No edit summary |
Matt Pijoan (talk | contribs) No edit summary |
||
Line 13: | Line 13: | ||
$timer1 = $('#output1'); | $timer1 = $('#output1'); | ||
Obj1.Timer = $.timer(updateTimer, incrementTime, true); | Obj1.Timer = $.timer(updateTimer, incrementTime, true); | ||
}; | |||
this.resetTimer = function(){ | |||
currentTime = 0; | |||
this.Timer.stop().once(); | |||
} | |||
$(init); | |||
}); | |||
var Obj2 = new (function(){ | |||
var $timer2, | |||
incrementTime = 100, | |||
currentTime = 100000, | |||
updateTimer = function() { | |||
$timer2.html(currentTime); | |||
currentTime -=incrementTime; | |||
}, | |||
init = function(){ | |||
$timer1 = $('#output2'); | |||
Obj2.Timer = $.timer(updateTimer, incrementTime, true); | |||
}; | }; | ||
this.resetTimer = function(){ | this.resetTimer = function(){ | ||
Line 21: | Line 39: | ||
}); | }); | ||
</script> | </script> | ||
<span id="output1"></span> | <span id="output1"></span> | ||
<span id="output2"></span> | <span id="output2"></span> | ||
</includeonly> | </includeonly> |