Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion jquery.periodic.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ jQuery.periodic = function (options, callback) {
ajax_complete : ajaxComplete,
increment : increment,
reset : reset,
cancel : cancel
cancel : cancel,
setPeriod : setPeriod
}, options);

// bookkeeping variables
Expand Down Expand Up @@ -84,6 +85,11 @@ jQuery.periodic = function (options, callback) {
clearTimeout(settings.tid);
settings.tid = null;
}

function setPeriod(new_period) {
settings.period = new_period;
reset();
}

// other functions we might want to implement
function pause() {}
Expand Down