Skip to content
maxkfranz edited this page Mar 8, 2012 · 7 revisions

eles.unbind()

Remove a callback function bound by eles.bind(), eles.one(), or eles.once().

eles.unbind()

Removes all callback functions for all event types for all elements in the collection

eles.unbind( eventType )

Removes all callback functions for the specified event types for all elements in the collection

eventType : A space-separated list of event types for which all handlers will be unbound

eles.unbind( eventType, handler )

Removes a specific callback function for the specified event types for all elements in the collection

eventType : A space-separated list of event types for which handler will be unbound
handler : A callback function to unbind

Details

When called without the handler argument, ele.unbind() removes all handlers bound to the element for the specified event types.

Examples

Unbind all handlers of type click:

cy.nodes().unbind("click"); // remove all click handlers for all nodes

Unbind a specific handler:

var handler = function(){ console.log("Click!"); }

cy.nodes("#n1").bind("click", handler);

// some time later

cy.nodes("#n1").unbind("click", handler);

Clone this wiki locally