美文网首页Front End
[jQuery] 事件传递参数

[jQuery] 事件传递参数

作者: 何幻 | 来源:发表于2016-03-04 07:17 被阅读14次

(1)绑定事件

$(selector).on('eventName',function(e, arg0, arg1){
    //...
});

注:
参数可以通过[].slice.call(arguments, 1)=[arg0,arg1,...]来获取。

(2)触发事件

$(selector).trigger('eventName', [arg0,arg1]);

相关文章

网友评论

    本文标题:[jQuery] 事件传递参数

    本文链接:https://www.haomeiwen.com/subject/voynkttx.html