Skip to content

Instantly share code, notes, and snippets.

Created March 29, 2013 22:03
What would you like to do?
NaturalWidth and NaturalHeight in IE7 and IE8 via
function getNatural (DOMelement) {
var img = new Image();
img.src = DOMelement.src;
return {width: img.width, height: img.height};
natural = getNatural(document.getElementById('example')),
nWidth = natural.width,
nHeight = natural.height;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment