Simplifying the camelCase logic used in the CSS and Effects modules.
[jquery.git] / src / effects.js
index 9c8abe5..9db341a 100644 (file)
@@ -3,7 +3,6 @@
 var elemdisplay = {},
        rfxtypes = /toggle|show|hide/,
        rfxnum = /^([+\-]=)?([\d+.\-]+)(.*)$/,
-       rdashAlpha = /-([a-z])/ig,
        timerId,
        fxAttrs = [
                // height animations
@@ -12,11 +11,7 @@ var elemdisplay = {},
                [ "width", "marginLeft", "marginRight", "paddingLeft", "paddingRight" ],
                // opacity animations
                [ "opacity" ]
-       ],
-
-       fcamelCase = function( all, letter ) {
-               return letter.toUpperCase();
-       };
+       ];
 
 jQuery.fn.extend({
        show: function( speed, callback ) {
@@ -125,7 +120,7 @@ jQuery.fn.extend({
                                self = this;
 
                        for ( p in prop ) {
-                               var name = p.replace(rdashAlpha, fcamelCase);
+                               var name = jQuery.camelCase( p );
 
                                if ( p !== name ) {
                                        prop[ name ] = prop[ p ];