jquery 手册
Ajax
属性(Attributes)
回调对象(Callbacks ..
核心(Core)
CSS
数据(Data)
延迟对象(Deferred o ..
尺寸(Dimensions)
效果(Effects)
事件(Events)
表单(Forms)
文档操作(Manipulati ..
杂项(Miscellaneou ..
位置(Offset)
插件编写(Plugin Aut ..
属性(Properties)
选择器(Selectors)
遍历(Traversing)
工具(Utilities)

Returns: undefinedundefined .callbacks.remove( Function callbacks )

描述: 从回调列表移除一个或一组回调函数。
  • version added: 1.7
  • .callbacks.remove( Function callbacks )
  • callbacks 移除的函数或函数数组。

Example

callbacks.remove() 从回调列表移除回调函数。

Example

callbacks.lock() 锁定一个回调列表避免进一步改变列表状态:


<!DOCTYPE html>
<html>
<head>
  <script src="../jquery.min.js"></script>
  <body>
  <script>

// a sample logging function to be added to a callbacks list
var foo = function( value ){
    document.write( 'foo:' + value);
}

var callbacks = $.Callbacks();

// add the function 'foo' to the list
callbacks.add( foo );

// fire the items on the list
callbacks.fire( 'hello' ); // outputs: 'foo: hello'

// remove 'foo' from the callback list
callbacks.remove( foo );

// fire the items on the list again
callbacks.fire( 'world' );  

// nothing output as 'foo' is no longer in the list

</script>
</body>
</html>

Demo:

Examples: