Bug Tracker

Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#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:
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");

Change History (2)

comment:1 Changed 8 years ago by snover

Resolution: invalid
Status: newclosed

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.

comment:2 Changed 8 years ago by Motty

DOH, well it's still a bug, I'll open a new ticket.

Note: See TracTickets for help on using tickets.