Side navigation
#5953 closed bug (worksforme)
Opened January 27, 2010 07:55AM UTC
Closed November 21, 2010 01:54AM UTC
Last modified March 15, 2012 11:05AM UTC
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 (5)
Changed January 27, 2010 08:14AM UTC by comment:1
Changed February 05, 2010 04:41AM UTC by comment:2
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] );
Changed February 06, 2010 03:05AM UTC by comment:3
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.
Changed June 14, 2010 12:48AM UTC by comment:4
component: | unfiled → fx |
---|
Changed November 21, 2010 01:54AM UTC by comment:5
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