Documentation

Plugins/livequery/livequery

From jQuery JavaScript Library

Jump to: navigation, search

« Back to Plugins/livequery

livequery( type, fn )

Binds an event handler to all matched elements of the given type.
The events are also bound to any new elements added to the DOM via jQuery methods if matched. An event is unbound from an element if the element is changed and no longer matched.
Arguments:
typeString
An event type.
fnFunction
A function to bind to the event on each of the matched elements
function callback(eventObject) {
  this; // dom element
}

livequery( matchedFn )

Fires a function (matchedFn) for each matched element.
The function is also fired for any new elements added to the DOM via jQuery methods if matched.
Arguments:
matchedFnFunction
A function to call when the element is matched.
function matched() {
  this; // dom element
}

livequery( matchedFn, unmatchedFn )

Fires a function (matchedFn) for each matched element and another function (unmatchedFn) for elements no longer matched.
The matchedFn is also fired for any new elements added to the DOM via jQuery methods if matched. The unmatchedFn is fired when an element changes and is no longer matched or removed from the DOM.
Arguments:
matchedFnFunction
A function to call when the element is matched.
function matched() {
  this; // dom element
}
unmatchedFnFunction
A function to call when the element is no longer matched.
function unmatched() {
  this; // dom element
}