Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Basically setTimeout with more options.
JavaScript CSS
Branch: master

Merge pull request #11 from iurisilvio/finally

Call setTimer() again even after action() error.
latest commit 233601da25
@jchavannes authored
Failed to load latest commit information.
res Updated demo and readme
README.md Update README.md
demo.html Updated demo and readme
jquery.timer.js Call setTimer() again even after action() error.

README.md

jQuery Timer

Basically setTimeout with more options.

View demo: http://jchavannes.com/jquery-timer/demo

Download: 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
Something went wrong with that request. Please try again.