public
Created

getComputedStyle(function)

  • Download Gist
getComputedStyle.js
JavaScript
1 2 3 4 5
if(typeof getComputedStyle === "undefined") {
var getComputedStyle = function(targetElm){
return document.defaultView.getComputedStyle(targetElm, "") || targetElm.currentStyle;
};
}
memo.txt
1 2 3 4 5
※ネイティブの getComputedStyle は擬似要素の指定も可能だが、この関数では不可。
 
## usage ##
var bodyStyles = getComputedStyle(document.body);
console.log(bodyStyles["color"]);

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.