我想知道如何更改 jQuery 回调函数的上下文,this使其与父函数中的上下文相同。
举个例子:
var context = this;
console.log(context);
element.animate(css, speed, type, function () {
     var new_context = this;
     console.log(new_context);
});
我将如何使它new_context等于context?
我意识到我可以这样做:
var new_context = context;
但是有没有更好的方法来告诉函数使用不同的上下文?