#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: |
Description
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);
and
- - 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)
Change History (6)
Changed 13 years ago by
Attachment: | ticket.txt added |
---|
comment:1 Changed 13 years ago by
comment:2 Changed 13 years ago by
I use this:
- 5618
var altName = this.prop.replace( /([a-z])([A-Z])/g, function(s,b1,b2){return b1 + "-" + b2.toLowerCase()} ); var specialEasing = this.options.specialEasing && (this.options.specialEasing[this.prop] || this.options.specialEasing[altName] );
comment:3 Changed 13 years ago by
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
Component: | unfiled → fx |
---|
comment:5 Changed 12 years ago by
Priority: | major → low |
---|---|
Resolution: | → worksforme |
Status: | new → closed |
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.
sorry $("span").animate({font-size:'2em'}, {duration: 1000, specialEasing: {'fontSize': 'special'}}); this won't work also