Bug Tracker

Modify

Ticket #7064 (closed bug: invalid)

Opened 14 months ago

Last modified 14 months ago

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

comment:1 Changed 14 months ago by snover

  • Status changed from new to closed
  • Resolution set to invalid

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 14 months ago by Motty

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

Please follow the  bug reporting guidlines and use  jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

View

Add a comment

Modify Ticket

Action
as closed
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.