ropacity = /opacity=([^)]*)/,
rdashAlpha = /-([a-z])/ig,
rupper = /([A-Z])/g,
ropacity = /opacity=([^)]*)/,
rdashAlpha = /-([a-z])/ig,
rupper = /([A-Z])/g,
return jQuery.access( this, name, value, true, function( elem, name, value ) {
return value !== undefined ?
jQuery.style( elem, name, value ) :
return jQuery.access( this, name, value, true, function( elem, name, value ) {
return value !== undefined ?
jQuery.style( elem, name, value ) :
- get: function( elem ) {
- // We should always get a number back from opacity
- var ret = curCSS( elem, "opacity", "opacity" );
- return ret === "" ? "1" : ret;
+ 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;
+ }
- var ret, origName = name.replace( rdashAlpha, fcamelCase ),
+ var ret, origName = jQuery.camelCase( name ),
style = elem.style, hooks = jQuery.cssHooks[ origName ];
name = jQuery.cssProps[ origName ] || origName;
style = elem.style, hooks = jQuery.cssHooks[ origName ];
name = jQuery.cssProps[ origName ] || origName;
// If a hook was provided, use that value, otherwise just set the specified value
if ( !hooks || !("set" in hooks) || (value = hooks.set( elem, value )) !== undefined ) {
// If a hook was provided, use that value, otherwise just set the specified value
if ( !hooks || !("set" in hooks) || (value = hooks.set( elem, value )) !== undefined ) {
css: function( elem, name, extra ) {
// Make sure that we're working with the right name
css: function( elem, name, extra ) {
// Make sure that we're working with the right name
- var ret, origName = name.replace( rdashAlpha, fcamelCase ),
+ var ret, origName = jQuery.camelCase( name ),
jQuery.cssHooks.opacity = {
get: function( elem, computed ) {
// IE uses filters for opacity
jQuery.cssHooks.opacity = {
get: function( elem, computed ) {
// IE uses filters for opacity
- "alpha(opacity=" + value * 100 + ")";
-
- var filter = style.filter || elem.currentStyle.filter || "";
+ "alpha(opacity=" + value * 100 + ")",
+ filter = style.filter || "";
style.filter = ralpha.test(filter) ?
filter.replace(ralpha, opacity) :
style.filter = ralpha.test(filter) ?
filter.replace(ralpha, opacity) :
} else if ( document.documentElement.currentStyle ) {
curCSS = function( elem, name ) {
} else if ( document.documentElement.currentStyle ) {
curCSS = function( elem, name ) {
- var left, rsLeft, ret = elem.currentStyle[ name ], style = elem.style;
+ var left, rsLeft, ret = elem.currentStyle && elem.currentStyle[ name ], style = elem.style;
// From the awesome hack by Dean Edwards
// http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-102291
// From the awesome hack by Dean Edwards
// http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-102291