Modify ↓
Ticket #7064 (closed bug: invalid)
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: | |
| Blocking: | Blocked by: |
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");
Change History
Please follow the bug reporting guidlines and use jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.
Note: See
TracTickets for help on using
tickets.

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.