So I am dynamically creating an image and I wish to get the image dimensions. Is it possible to do this before the image is attached to the DOM? At the moment I am doing this:
var arrow = $('<img src="' + parameters.arrowRight + '" />');
arrow.load(function() {
console.log("size: " + $(this).height() + " " + $(this).width());
});
but the height and width are both reported as zero. The image is actually being fetched as I can see the GET request in firebug.