I think it has something to do with a function running in a difference scope from where the jquery library is not accessable (shown being called as the last parameter on the second line below)
var funcExpandHeight = container.animate({
height: '300px'
}, 300, function () {});
foo.animate({
height: 'show'
}, 300, funcExpandHeight);
Line one works, then crashes on 'f.easing[i.animatedProperties[this.prop]] is not a function'
Munging the lines up together as show below, and the operation completes successfully.
foo.animate({
height: 'show'
}, 300, function () {
container.animate({
height: container[0].scrollHeight + 'px'
}, 300, function () {})
});
Third argument of
.animate()is callback function, but in your first code you’re just passing a variable.NOTE
config of
.animate()is like following:Where
[]means optional.In your code, you don’t give the
easingso, the third argument will treat as complete callback function.For more detail see above link.