我正在使用 jQuery this._on()
函数来绑定(bind)鼠标事件,我想在 this._on()
中使用事件捕获概念。
this._on($("#myId"), "mousedown", callMouseDown);
callMouseDown: function (e) {
//Mouse down event
},
任何人都可以帮助我,这里如何应用事件捕获概念(父级到子级)。
谢谢, 巴拉蒂。
最佳答案
使用 this
访问您的方法。
this._on($("#myId"), "mousedown", this.callMouseDown);
callMouseDown: function (e) {
//Mouse down event
},
更新:
jQuery 事件不支持事件捕获。但它支持事件冒泡。
请查看以下链接了解更多信息
Why does jQuery event model does not support event Capture and just supports event bubbling
关于javascript - 如何在 jQuery 中使用事件捕获概念 this._on();,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33273591/