Counts up to a specified end time
Counts up indefinitely
Counts down once from a starting point to zero
Counts down from a starting point to zero for a set number of repetitions
Counts down from a starting point to zero, then counts down from a second starting point to zero, for a set number of repetitions
Shows how you can bind code to start, pause, restart, roundComplete, and complete events.
Code example:
// Define a function or functions to handle timer events.
var $eventLog = $('#event-log');
var logEvent = function(eventType, eventTarget, timer) {
var newLog = '"' + eventType + '" event triggered on #' + eventTarget.attr('id') + '\r\n';
$eventLog.val( newLog.concat( $eventLog.val() ) );
};
// Pass in event handlers as part of the options object
$('.workout-timer-events').workoutTimer({
onStart: logEvent,
onRestart: logEvent,
onPause: logEvent,
onRoundComplete: logEvent,
onComplete: logEvent
});
The target function receives three parameters: