I’m dynamically adding IMG components to my DOM using JQuery, but depending on how big they are, I’ll be adding them in different ways. Anyone have a good idea for getting the IMG’s auto sized dimensions BEFORE I add it to the DOM?
NOTE: I was playing around with DOM snippet JQuery manipulation, as described here, but the img dimensions were = 0.
You should be able to do this without appending the image to the DOM. Kristoffer (hey that’s my name too!) is on the right track but the image needs to be loaded before you can try to read the width / height.
Demo here: http://jsfiddle.net/H3p97/