-
-
Save Nikolasgrizli/f19d5f3d349feaef72b33dd581401b09 to your computer and use it in GitHub Desktop.
Get exact value property (height example)
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
// if value in html | |
var height = $("element").get(0).style.height; | |
// if value in css | |
var rules = document.styleSheets[0].rules || document.styleSheets[0].cssRules; | |
for(var i=0; i < rules.length; i++) { | |
var rule = rules[i]; | |
if (rule.selectorText.toLowerCase() == "element") { | |
var width = rule.style.getPropertyValue("height"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment