jQuery timers

Software Screenshot:
jQuery timers
Software Details:
Version: 1.2
Upload Date: 6 Jun 15
Developer: jquery.offput.ca
Distribution Type: Freeware
Downloads: 15
Size: 3 Kb

Rating: 2.5/5 (Total Votes: 2)

jQuery timers is an attempt to combine jQuery's concise chaining programming style with a style in which timed events are coded in JavaScript to produce a friendlier and more intuitive timed event system.

In addition, it fixes the most prevalent issue with the various event systems of JavaScript: misconfigured scope.

All the methods you design to use in setTimeout/setInterval in JavaScript cannot use 'this' to reference the desired element because 'this' always references the window object.

Because of this, closures are required to produce useful code. Without the need for closures, these methods could be stored inside the class rather than inside the calling method which would produce a more modular and object oriented style of coding.

Features:

  • Abstracted Timer IDs - When you call setTimeout or setInterval with the intention of possibly stopping it later on you need to save the reference to the timer id. This is really cumbersome especially when you want loosely coupled activation deactivation of events. This plugin fixes that by storing the timer id internally and using it behind the scenes when stopping events.
  • Labelled Events - When you create a timed event, you have the option of giving it a label. These labels allow for multiple timed events to operate on the same object with fine control over which method you want to stop.
  • Limited Events - Beyond simply running once in a given amount of time and running every given amount of time, sometimes there is a need to run at a given time interval but only for a certain number of times.
  • Intelligent Event Belay - Sometimes when you have an event which is supposed to run every 500 milliseconds but every so often the function the event calls happens to take 600 milliseconds. jQuery timers lets you belay an instance of the event if the previous event is still running. This is disabled by default.
  • String Time Parsing - Too often, people try to use setTimeout or setInterval to do something every second but forget that they both take milliseconds. jQuery timers allows you to specify your time as a string. It include the SI prfixed time values for 'ms', 'cs', 'ds', 's', 'das', 'ws', and 'ks' which may be overkill but because milliseconds and seconds were already being added, the others were trivial to implement.

Requirements:

  • JavaScript enabled on client side
  • jQuery

Similar Software

Timeglider
Timeglider

21 Jul 15

jq.entry
jq.entry

12 May 15

Comments to jQuery timers

Comments not found
Add Comment
Turn on images!