1

次のようにイベントをバインドすると:

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 があります。

4

0 に答える 0