Skip to content
Permalink
Browse files

Fix for animating hyphenated CSS properties. Fixes #4156.

  • Loading branch information
jeresig committed Jul 25, 2009
1 parent fd0bf5d commit 343b0936a43953a993d1f2cc500b954d5bcc8280
Showing with 20 additions and 0 deletions.
  1. +8 −0 src/fx.js
  2. +12 −0 test/unit/fx.js
@@ -109,6 +109,14 @@ jQuery.fn.extend({
self = this;

for ( p in prop ) {
var name = p.replace(rdashAlpha, fcamelCase);

if ( p !== name ) {
prop[ name ] = prop[ p ];
delete prop[ p ];
p = name;
}

if ( prop[p] == "hide" && hidden || prop[p] == "show" && !hidden )
return opt.complete.call(this);

@@ -100,6 +100,18 @@ test("animate duration 0", function() {
});
});

test("animate hyphenated properties", function(){
expect(1);
stop();

jQuery("#nothiddendiv")
.css("font-size", 10)
.animate({"font-size": 20}, 200, function(){
equals( this.style.fontSize, "20px", "The font-size property was animated." );
start();
});
});

test("animate non-element", function(){
expect(1);
stop();

0 comments on commit 343b093

Please sign in to comment.
You can’t perform that action at this time.