オブジェクトのプロトタイプでは、
obj.prototype.function1 = function(){
$(window).on("scroll",$.proxy(this.trigger,this));
}
別のプロトタイプでは、
obj.prototype.function2 = function(){
$(window).off("scroll",this.trigger);
}
しかし$(window).off("scroll",this.trigger);、拘束力はありませんthis.trigger。
そのため、in$.proxy(this.trigger,this)のプロパティとして作成してみました:objfunction1
this.triggery = $.proxy(this.trigger,this);
でオフにしfunction2ます:
$(window).off("scroll",this.triggery);
しかし、それはまだ編集できません.off。
このようなイベントハンドラのバインドを解除するにはどうすればよいですか?
PS私は従来のものを使ってみまし.bindた.unbindが、役に立ちませんでした。