0

他のメソッドでこの方法でコンテキストを処理できますが、.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);
4

1 に答える 1

0

このようにしてみましたか:

$(window).resize(function() {
    D4.prototype.resize('prototype:');
    myD4.resize('instance:')
});
于 2012-05-06T22:31:29.587 に答える