I’m loading an image using jquery:
var myImg = new Image();
$(myImg).load(function(){
console.log("image dimensions:"); // what should I put here ?
}).attr("src", "/path/toImg/");
When the img is loaded, is there a way to get it’s width and height ?
Notice that the problem is that I want to have this info BEFORE the img is appended to the body.
it should just be:
Demo at http://jsfiddle.net/alnitak/c4JJf/