Created
December 31, 2014 15:27
-
-
Save fredyang/5cd8e6a5ed03a7ed8ad1 to your computer and use it in GitHub Desktop.
get current style for element
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
function getStyle(element, key) { | |
var node = element[0]; | |
return node.currentStyle ? | |
node.currentStyle[key] : | |
$window.getComputedStyle(node)[key]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment