Commit 343b0936 authored by John Resig's avatar John Resig

Fix for animating hyphenated CSS properties. Fixes #4156.

parent fd0bf5d6
...@@ -109,6 +109,14 @@ jQuery.fn.extend({ ...@@ -109,6 +109,14 @@ jQuery.fn.extend({
self = this; self = this;
for ( p in prop ) { 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 ) if ( prop[p] == "hide" && hidden || prop[p] == "show" && !hidden )
return opt.complete.call(this); return opt.complete.call(this);
......
...@@ -100,6 +100,18 @@ test("animate duration 0", function() { ...@@ -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(){ test("animate non-element", function(){
expect(1); expect(1);
stop(); stop();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment