猿问
jquery绑定事件handler传入一个表达式?
如图所示,handler参数这里传入了一个表达式 ,这个是什么意思?
拉风的咖菲猫
浏览 583
回答 1
1回答
月关宝盒
$(document).on("click", (this._mouseclick = function(e) { }));// 等价于this._mouseclick = function(e) { }; $(document).on("click", this._mouseclick);就是把两句话写成了一句话。this._mouseclick 现在看来是没有什么用,但是如果需要调用 off() 来去掉某个事件处理函数的时候,就比较有用了,比如{ bind: function() { }, unbind: function() { $(document).off("click", this._mouseclick); } }
0
0
0
随时随地看视频
慕课网APP
相关分类
JavaScript
我要回答