Last active
August 29, 2015 14:01
-
-
Save gibson042/03bd6ecd8cfefeaaa9ae to your computer and use it in GitHub Desktop.
jQuery #15098 remote src
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// http://bugs.jquery.com/ticket/15098 | |
(function( window ) { | |
var getStyles, curCSS; | |
if ( window.getComputedStyle ) { | |
getStyles = function( elem ) { | |
return elem.ownerDocument.defaultView.getComputedStyle( elem, null ); | |
}; | |
curCSS = function( elem, name, computed ) { | |
var ret; | |
computed = computed || getStyles( elem ); | |
ret = computed ? computed.getPropertyValue( name ) || computed[ name ] : undefined; | |
if ( computed ) { | |
if ( ret === "dummy-block" ) { | |
ret = elem[ name ]; | |
} | |
} | |
return ret; | |
}; | |
} | |
window.simpleCSS = function( elem, name, extra, styles ) { | |
var val; | |
name = name in elem.style ? name : "Moz" + name.charAt(0).toUpperCase() + name.slice(1); | |
if ( val === undefined ) { | |
val = curCSS( elem, name, styles ); | |
} | |
if ( val === "dummy-block" ) { | |
val = curCSS[ val ]; | |
} | |
return val; | |
}; | |
})( typeof window !== "undefined" ? window : this ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment