Side navigation
#7064 closed bug (invalid)
Opened September 22, 2010 04:23PM UTC
Closed September 22, 2010 08:32PM UTC
Last modified September 22, 2010 11:02PM UTC
Animation breaks with incorrect easing name
| Reported by: | Motty | Owned by: | |
|---|---|---|---|
| Priority: | Milestone: | 1.4.3 | |
| Component: | unfiled | Version: | 1.4.2 |
| Keywords: | easing animation | Cc: | |
| Blocked by: | Blocking: |
Description
When an incorrect easing name/function is added as an option, it fails gracefully;
$("#block").animate({
width: "50%",
easing: "schwing" // incorrect easing name won't break the animation
}, 1500);
But if it is added as a string, this and all subsequent animations fail to work:
$("#block").animate({
width: "100px"
}, 1500, "schwing"); // incorrect easing name WILL break the animation
Demo here: http://jsfiddle.net/smSaS/
I believe this might fix it, but maybe someone who knows the core better can find a better solution:
Line 5853:
var defaultEasing = jQuery.isFunction($.easing[this.options.easing]) ? this.options.easing : (jQuery.easing.swing ? "swing" : "linear");
The example provided is invalid, because the first object passed to .animate only contains the CSS properties. The correct syntax would be
.animate({ width: '50%' }, { easing: 'schwing' }), which will fail in the same way as your second example.