Created
March 29, 2013 22:03
-
-
Save jalbertbowden/5273983 to your computer and use it in GitHub Desktop.
NaturalWidth and NaturalHeight in IE7 and IE8 via http://www.jacklmoore.com/notes/naturalwidth-and-naturalheight-in-ie/
This file contains 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
function getNatural (DOMelement) { | |
var img = new Image(); | |
img.src = DOMelement.src; | |
return {width: img.width, height: img.height}; | |
} | |
var | |
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