Created
March 24, 2013 13:37
-
-
Save ourmaninamsterdam/5232000 to your computer and use it in GitHub Desktop.
Get computed style of elements and pseudo elements
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 getComputedStyle(elem, property, pseudoelem){ | |
return window.getComputedStyle(elem, (pseudoelem || null)).getPropertyValue(property); | |
}; | |
getComputedStyle(myElem, "height").width; | |
getComputedStyle(myElem, "height", ":after").width; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment