Cross-browser (IE8-) getComputedStyle with Javascript?
Here’s a cross-browser function to get a computed style… getStyle = function (el, prop) { if (typeof getComputedStyle !== ‘undefined’) { return getComputedStyle(el, null).getPropertyValue(prop); } else { return el.currentStyle[prop]; } } You may store it as an utility within an object, or just use it as provided. Here’s a sample demo! // Create paragraph element … Read more