jsApplicationTimer – a smart javascript timer for web applications

Maybe you want to develop a web application that needs to restart or do any action if user doesn’t interacts with your script during a few time.

jsApplicationTimer is the ideal solution for you.
It helps you to simply trigger a function if user hasn’t interacted with a selector you specified, in an interval of time you have specified.

It is so simple. This is how it works:

//Instantiate the object
var applicationTimer = new jsApplicationTimer();

//Set parameters
applicationTimer.callBackMethod = stopTimer;
applicationTimer.timer  = 5; //Time in seconds
applicationTimer.start();

//Callback method
function stopTimer() {
    alert('Hello world!');
}

The complete code is hosted on Github: https://github.com/edouardkombo/jsApplicationTimer
 
Demo is available here: https://edouardkombo.github.io/jsApplicationTimer/demo
 
To download from Bower:

bower install js-application-timer
Advertisements
jsApplicationTimer – a smart javascript timer for web applications

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s