在一个对象的原型中,我有
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-ed;
我应该如何取消绑定这样的事件处理程序?
PS我尝试过使用传统的.bind,.unbind但无济于事。