This project is read-only.

Use to create an event (or multiple event) handler for an element that will execute after a delay. The the same event(s) on the same element and/or different events on the same or different elements can be set to extend the delay of or altogether cancel the handling of the original event.

Example

<input type="button" value="Test" id="testButton" />
$("#testButton").delayedAction({events: "click",
    eventHandler: function() { alert("Hello"); },
    delayMilliseconds: 2000,
    delayElementsSelector: "#delayButton",
    delayElementsEvents: "click",
    cancelElementsSelector: "#cancelButton",
    cancelElementsEvents: "mouseover click"});

Parameters

  • events - A space-delimited list of events that should trigger the event handler. (Default = "")
  • eventHandler - The function to call when any of the above events occur. (Default = empty function)
  • delayMilliseconds - The number of milliseconds to delay prior to invoking the event handler. (Default = 100)
  • delayElementsSelector - Optional jQuery selector for the elements that should cause the delay timer to reset. (Default = null)
  • delayElementsEvents - Optional space-delimited list of events (for elements matching the previous selector) that should trigger the delay timer to reset. (Default = "")
  • cancelElementsSelector - Optional jQuery selector for the elements that should cause the delay timer to stop. (Default = null)
  • cancelElementsEvents - Optional space-delimited list of events (for elements matching the previous selector) that should trigger the delay timer to stop. (Default = "")

Last edited Jul 10, 2012 at 3:16 AM by cmaterick, version 6

Comments

No comments yet.