Skip to content

Instantly share code, notes, and snippets.

@evert0n
Forked from gkatsev/computedStyle.js
Created June 6, 2017 05:40
Show Gist options
  • Save evert0n/89b067425a50214b7d2c227ba7ac88dd to your computer and use it in GitHub Desktop.
Save evert0n/89b067425a50214b7d2c227ba7ac88dd to your computer and use it in GitHub Desktop.
getComputedStyle shim
computedStyle = function(el, prop) {
if (typeof getComputedStyle === 'function') {
return getComputedStyle(el)[prop];
} else {
return el.currentStyle[prop];
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment