jQuery callbacks.remove()Method

jQuery 杂项方法jQuery Miscellaneous Methods

Examples

Use callbacks.remove() to remove callbacks from the callback list

$(function () { //A simple test function var foo = function( value ) { alert( "foo:" + value ); }; var callbacks = $.Callbacks(); //Add test function foo to the list callbacks.add( foo ); //Call all callbacks with the passed arguments callbacks.fire( "hello" ); //Outputs "foo: hello" //Lock the callback list callbacks.remove(foo); //Test the state of the callback list callbacks.fire( "world" ); //No output, because there is no "foo" callback function in the list })

Try it »

Definition and Usage

The callbacks.remove() function is used to remove a callback or a collection of callbacks from the callback list.

This method returns a callback object to the callback list to which it is bound.


Syntax

callbacks.remove( callbacks )

Parameters Description
callbacks Function, Array type: A function or an array of functions to be removed from the callback list.


jQuery 杂项方法jQuery Miscellaneous Methods

Other Extensions