There are two ways to instantiate. Either statically, or on an element. Element bound timers will only watch for
events inside of them. You may just want page-level activity, in which case you may set up your timers on
document
, document.documentElement
, and document.body
.
$(function() {
// binds to document - shorthand
$.idleTimer();
// binds to document - explicit
$( document ).idleTimer();
// bind to different element
$( "#myTextArea" ).idleTimer();
});
Element to watch, defaults to the document.
Unique ID for this idle timer, to support multiple timers on the same page.
this JQuery instance for chaining.
There are two ways to instantiate. Either statically, or on an element. Element bound timers will only watch for
events inside of them. You may just want page-level activity, in which case you may set up your timers on
document
, document.documentElement
, and document.body
.
$(function() {
// binds to document - shorthand
$.idleTimer(1000);
// binds to document - explicit
$( document ).idleTimer(1000);
// bind to different element
$( "#myTextArea" ).idleTimer(1000);
});
The timeout period in milliseconds.
Element to watch, defaults to the document.
Unique ID for this idle timer, to support multiple timers on the same page.
this JQuery instance for chaining.
There are two ways to instantiate. Either statically, or on an element. Element bound timers will only watch for
events inside of them. You may just want page-level activity, in which case you may set up your timers on
document
, document.documentElement
, and document.body
.
$(function() {
// binds to document - shorthand
$.idleTimer({
timeout:10000,
idle:true
});
// binds to document - explicit
$( document ).idleTimer({
timeout:10000,
idle:true
});
// bind to different element
$( "#myTextArea" ).idleTimer({
timeout:10000,
idle:true
});
});
The options for this idle timer. Any options not specified explicitly are set to their default values.
Element to watch, defaults to the document.
Unique ID for this idle timer, to support multiple timers on the same page.
this JQuery instance for chaining.
Stop the timer, removes data, removes event bindings to come back from this you will need to instantiate again.
The method to be invoked on this idle timer instance.
Element to watch, defaults to the document.
Unique ID for this idle timer, to support multiple timers on the same page.
this JQuery instance for chaining.
Saves the remaining time, and stops the timer.
The method to be invoked on this idle timer instance.
Element to watch, defaults to the document.
Unique ID for this idle timer, to support multiple timers on the same page.
this JQuery instance for chaining.
Starts the timer with remaining time saved when pause
was called.
The method to be invoked on this idle timer instance.
Element to watch, defaults to the document.
Unique ID for this idle timer, to support multiple timers on the same page.
this JQuery instance for chaining.
Restore initial idle state, and restart the timer.
The method to be invoked on this idle timer instance.
Element to watch, defaults to the document.
Unique ID for this idle timer, to support multiple timers on the same page.
this JQuery instance for chaining.
Get time left until idle. If currently idle, returns 0.
The method to be invoked on this idle timer instance.
Element to watch, defaults to the document.
Unique ID for this idle timer, to support multiple timers on the same page.
The time in milliseconds until the user goes idle. If user is already idle, returns 0
.
Get time elapsed since the user went idle or active.
The method to be invoked on this idle timer instance.
Element to watch, defaults to the document.
Unique ID for this idle timer, to support multiple timers on the same page.
How long the user has been idle or active, in milliseconds.
Get time the last active.idleTimer
event was fired.
The method to be invoked on this idle timer instance.
Element to watch, defaults to the document.
Unique ID for this idle timer, to support multiple timers on the same page.
A timestamp (milliseconds since 1 January 1970 UTC) for when the most recent time the user went from idle to active.
Get whether the user is currently idle.
The method to be invoked on this idle timer instance.
Element to watch, defaults to the document.
Unique ID for this idle timer, to support multiple timers on the same page.
true
if the user is currently idle, or false
if the user is currently active.
Generated using TypeDoc
Interface with all the methods supported by the jQuery Idle Timer plugin. These metods are available on JQuery instances as well as on the static JQuery object: