g(..).removeEvent(eventName, handlerFn, [useCapture])

Removes the event listener/handler, handlerFn, for the specified event, eventName, from each element in the Gimme Object's internal array

Returns: Itself (the same Gimme Object is returned so additional methods can be chained together seamlessly).
  • eventName, required: The string name of a previously wired up event. This should not include the prefix "on."
  • handlerFn, required: A reference to the function handler that was specified for the event, eventName, in a previous call to .addEvent(..).
  • useCapture, optional (default = false): Specified whether or not to use event capture (currently only supported in W3C browsers).

// removes the click event handler, sayHello, from all <div> elements on the page
g('div').removeEvent('click', sayHello);

// removes the mouseover event handler, fn1, and the mouseout event handler, fn2, from all <p> elements on the page.
g('p').removeEvent('mouseover', fn1).removeEvent('mouseout', fn2);

// removes the mousedown event handler, foo, from all <img> elements that have that the class "special" and which are direct children of <p> elements
g('p > img.special').removeEvent('mousedown', foo);

Last edited Jun 7, 2007 at 7:16 PM by sstchur, version 2


No comments yet.