这篇文章主要介绍如何使用callbacks.remove(),文中介绍的非常详细,具有一定的参考价值,感兴趣的小伙伴们一定要看完! callbacks.remove( callbacks ) 描
这篇文章主要介绍如何使用callbacks.remove(),文中介绍的非常详细,具有一定的参考价值,感兴趣的小伙伴们一定要看完!
callbacks.remove( callbacks )
描述: 从回调列表中的删除一个回调或回调集合。
添加的版本: 1.7callbacks.remove( callbacks )
callbacks
类型: Function, Array
从回调列表中删除的一个函数,或者函数数组。
此方法返回绑定它的那个回调对象 (this).
例子:
使用 callbacks.remove() 从回调列表中的删除回调:
// a sample logging function to be added to a callbacks list
var foo = function( value ) {
console.log( "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
以上是“如何使用callbacks.remove()”这篇文章的所有内容,感谢各位的阅读!希望分享的内容对大家有帮助,更多相关知识,欢迎关注编程网node.js频道!
--结束END--
本文标题: 如何使用callbacks.remove()
本文链接: https://www.lsjlt.com/news/91656.html(转载时请注明来源链接)
有问题或投稿请发送至: 邮箱/279061341@qq.com QQ/279061341
下载Word文档到电脑,方便收藏和打印~
2022-06-04
2022-06-04
2022-06-04
2022-06-04
2022-06-04
2022-06-04
2022-06-04
2022-06-04
2022-06-04
2022-06-04
回答
回答
回答
回答
回答
回答
回答
回答
回答
回答
0