Bug Tracker

Opened 13 years ago

Closed 12 years ago

Last modified 11 years ago

#5953 closed bug (worksforme)

specialEasing in animate

Reported by: Axdr Owned by:
Priority: low Milestone: 1.4.2
Component: effects Version: 1.4.1
Keywords: Cc:
Blocked by: Blocking:


If you're trying to animate font size using special per-property easing it won't work. For example:

$("span").animate({font-size:'2em'}, {duration: 1000, specialEasing: {'font-size': 'special'}});

A conflict is between

  • - 5328 var name = p.replace(rdashAlpha, fcamelCase);


  • - 5618 var specialEasing = this.options.specialEasing && this.options.specialEasing[this.prop];

this.prop will be 'fontSize' instead of 'font-size' but 'fontSize' is not a CSS name. This will work:

$("span").animate({font-size:'2em'}, {duration: 1000, specialEasing: {'fontSize': 'special'}});

Sorry for my awful english.

Attachments (1)

ticket.txt (732 bytes) - added by Axdr 13 years ago.

Download all attachments as: .zip

Change History (6)

Changed 13 years ago by Axdr

Attachment: ticket.txt added

comment:1 Changed 13 years ago by Axdr

sorry $("span").animate({font-size:'2em'}, {duration: 1000, specialEasing: {'fontSize': 'special'}}); this won't work also

comment:2 Changed 13 years ago by Axdr

I use this:

  • 5618
      var altName = this.prop.replace(
    	    function(s,b1,b2){return b1 + "-" + b2.toLowerCase()}
    	var specialEasing = 
              this.options.specialEasing && 
                (this.options.specialEasing[this.prop] ||  

comment:3 Changed 13 years ago by Axdr

This is better solution.

  • line 5330
        if ( p !== name ) {
            prop[ name ] = prop[ p ];
            delete prop[ p ]; 
            p = name;

must be changed

    if ( p !== name ) {
        if (opt.specialEasing && opt.specialEasing[p]) {
            opt.specialEasing[name] = opt.specialEasing[p];
            delete opt.specialEasing[p];
        prop[ name ] = prop[ p ];
        delete prop[ p ]; 
        p = name;

The line 5618 rests unaffected.

comment:4 Changed 13 years ago by dmethvin

Component: unfiledfx

comment:5 Changed 12 years ago by jitter

Priority: majorlow
Resolution: worksforme
Status: newclosed

Thanks for taking the time to contribute to the jQuery project by writing a bug report and providing a testcase!

Your test case contained a syntax error and there is no easing called "special". After fixing these in your test code I uploaded a reconstructed version of your test case here test case.

This works just fine for me with no errors and the text animated.

If you feel this ticket was incorrectly closed or the bug still persists for you, feel free to report back with a reproducible test case and reopen the issue.

Note: See TracTickets for help on using tickets.