jquery originalEvent与event关系

来源:互联网 发布:阿里云解析新网域名 编辑:程序博客网 时间:2024/06/06 04:03

在jquery中,最终传入事件处理程序的 event 其实已经被 jQuery 做过标准化处理,

其原有的事件对象则被保存于 event 对象的 originalEvent 属性之中,

每个 event 都是 jQuery.Event 的实例
所以event.originalEvent.wheelDelta就是指向原始的事件对象


其原型链中保存有六个方法,

jQuery.Event.prototype = {     preventDefault: function() {         // 取消事件默认行为     },     stopPropagation: function() {         // 取消事件向上冒泡     },     stopImmediatePropagation: function() {         this.isImmediatePropagationStopped = returnTrue;         this.stopPropagation();     },     isDefaultPrevented: returnFalse,     isPropagationStopped: returnFalse,     isImmediatePropagationStopped: returnFalse };
原创粉丝点击