次のコードを使用します。
function animateTo(parent) {
    this.parent = $('#' + parent);
    console.log(this.parent)
    this.animator = function () {
        this.parent.animate({
            scrollTop: 5
        }, 5);
    }
}
test = new animateTo('data');
test.animator;
最初console.logはコンソールに完全なオブジェクトを表示しますが、実行しようとするthis.parent.animateとエラーが発生します:
Uncaught TypeError: Object [object global] has no method 'animate' animator.js:60
(anonymous function
その理由を説明できる人はいますか?私は試してみましたthis.parent.selectorが、正しい結果が得られましたが、animate メソッドを呼び出そうとすると、そのエラーが発生します。