我认为这与在不同范围内运行的函数有关,在该范围内无法访问 jquery 库(显示为下面第二行的最后一个参数)
var funcExpandHeight = container.animate({
height: '300px'
}, 300, function () {});
foo.animate({
height: 'show'
}, 300, funcExpandHeight);
第一行有效,然后崩溃'f.easing[i.animatedProperties[this.prop]] is not a function'
如下图所示,将这些线组合在一起,操作成功完成。
foo.animate({
height: 'show'
}, 300, function () {
container.animate({
height: container[0].scrollHeight + 'px'
}, 300, function () {})
});