- // Convert name, value params to options hash format
- } else {
- options = {};
- options[ name ] = value;
- }
- }
-
- var isFunction = {};
-
- // For each value, determine whether it's a Function so we don't
- // need to determine it again for each element
- for ( var prop in options )
- isFunction[prop] = jQuery.isFunction( options[prop] );
-
- // For each element...
- for ( var i = 0, l = this.length; i < l; i++ ) {
- var elem = this[i];
-
- // Set all the styles
- for ( var prop in options ) {
- value = options[prop];
-
- if ( isFunction[prop] ) value = value.call( elem, i );
-
- if ( typeof value === "number" && !exclude.test(prop) ) {
- value = value + "px";
+jQuery.extend({
+ // Add in style property hooks for overriding the default
+ // behavior of getting and setting a style property
+ cssHooks: {
+ opacity: {
+ get: function( elem, computed ) {
+ if ( computed ) {
+ // We should always get a number back from opacity
+ var ret = curCSS( elem, "opacity", "opacity" );
+ return ret === "" ? "1" : ret;
+
+ } else {
+ return elem.style.opacity;
+ }