README.md 0000644 0001750 0001750 00000002021 12470034324 011657 0 ustar reazem reazem # jQuery Timer Basically setTimeout with more options. View demo: [http://jchavannes.com/jquery-timer/demo](http://jchavannes.com/jquery-timer/demo) Download: [http://jchavannes.com/download/jquery-timer-demo.zip](http://jchavannes.com/download/jquery-timer-demo.zip) --- ## $.timer() #### $.timer( [ action ] , [ time ], [ autostart ] ) * **action** A Function to be called by the timer. * **time A Number** determining how long between actions in milliseconds. * **autostart** A Boolean indicating whether to start the timer. Defaults to false. --- ## Usage ``` var timer = $.timer(function() { alert('This message was sent by a timer.'); }); timer.set({ time : 5000, autostart : true }); ``` ``` timer.set(options); timer.play(reset); // Boolean. Defaults to false. timer.pause(); timer.stop(); // Pause and resets timer.toggle(reset); // Boolean. Defaults to false. timer.once(time); // Number. Defaults to 0. timer.isActive // Returns true if timer is running timer.remaining // Remaining time when paused ``` demo.html 0000755 0001750 0001750 00000007777 12470034324 012244 0 ustar reazem reazem
Project home: http://jchavannes.com/jquery-timer
timer has been executed 0 times.
var count = 0; var timer = $.timer(function() { $('#counter').html(++count); }); timer.set({ time : 1000, autostart : true });