[英]Can't access an object's context in window.resize()
我可以在其他方法中以这种方式处理上下文,但是我不确定.resize()有什么不同,或者不确定为什么无法在上下文中传递。
D4.prototype.resize = function() {
var that = this;
that.containerBound = that.getBound(that.containerId);
// that is referring to the DomWindow and not D4
};
$(window).resize(D4.prototype.resize);
你有没有尝试做这样的 :
$(window).resize(function() {
D4.prototype.resize('prototype:');
myD4.resize('instance:')
});
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.