jQuery callbacks.remove () method
Examples
Use callbacks.remove () callback from the callback list of deleted
$ (Function () {
// Simple test function
var foo = function ( value ) {
alert ( "Foo:" + value );}; Var . callbacks = $ Callbacks (); // add to the list of test function foo
callbacks. add ( foo ); // Invoke all callback parameters passed
callbacks. fire ( "Hello" ); // Output "foo: hello"
// Lock callback list
// Test status callback list;. callbacks remove (foo)
callbacks. fire ( "World" ); // NIE has an output, because the list is not "foo" callback
})
try it"
Definition and Usage
callbacks.remove () function is used to set a callback or callback removed from the callback list.
This method returns a callback object to the callback list it bound
grammar
callbacks.remove( callbacks )
参数 | 描述 |
---|---|
callbacks | Function,Array类型 要从回调列表中删除的一个函数或函数数组 |