diff options
Diffstat (limited to 'src/css.js')
-rw-r--r-- | src/css.js | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/css.js b/src/css.js index ea1037ded..3e14e1be3 100644 --- a/src/css.js +++ b/src/css.js @@ -285,12 +285,14 @@ if ( document.defaultView && document.defaultView.getComputedStyle ) { if ( document.documentElement.currentStyle ) { currentStyle = function( elem, name ) { - var left, rsLeft, + var left, rsLeft, uncomputed, ret = elem.currentStyle && elem.currentStyle[ name ], style = elem.style; - if ( ret === null && style ) { - ret = style[ name ]; + // Avoid setting ret to empty string here + // so we don't default to auto + if ( ret === null && style && (uncomputed = style[ name ]) ) { + ret = uncomputed; } // From the awesome hack by Dean Edwards |