Juery手册 专题
专题目录
您的位置:JS框架 > Juery手册专题 > Jquery1.7-callbacks.fireWith([context][,args])
Jquery1.7-callbacks.fireWith([context][,args])
作者:--    发布时间:2019-11-21

返回值:undefinedcallbacks.firewith([context][,args])

概述

禁用回调列表中的回调

参数

[context][,args]v1.7

context: 该列表中的回调被触发的上下文引用

args: 一个参数或参数列表传回给回调列表。

示例

描述:

使用 callbacks.firewith() 访问给定的上下文和参数列表中的所有回调。

jquery 代码:
// a sample logging function to be added to a callbacks list
var log = function( value1, value2 ){
    console.log( 'received:' + value1 + ',' + value2 );
}

var callbacks = $.callbacks();

// add the log method to the callbacks list
callbacks.add( log );

// fire the callbacks on the list using the context 'window'
// and an arguments array

callbacks.firewith( window, ['foo','bar']);

// outputs: received: foo, bar
网站声明:
本站部分内容来自网络,如您发现本站内容
侵害到您的利益,请联系本站管理员处理。
联系站长
373515719@qq.com
关于本站:
编程参考手册