当我绑定这样的事件时:
Selector.prototype.setupEventHandlers = function() {
var cssSelector = '*:not(.' + this.ignoreClass + ')';
jQuery(cssSelector).bind("mousedown", { 'self': this }, this.onSelectorMousedown);
};
让EventHandler像这样:
Selector.prototype.onSelectorMousedown = function(e) {
self = this;
...
}
我总是使用self = HTMLParagraphElement而不是真正被点击过的元素。