i want to to get the height/width of an image inside a hidden div-containter, but .height() and .width() both returns 0 (like expected).
.height()
.width()
Yes its because the image is not loaded yet and this is my solution:
$('').appendTo('body').css({ 'position': 'absolute', 'top': -1 }).load(function() { console.log('Image width: ' + $(this).width()); console.log('Image height: ' + $(this).height()); $(this).remove(); });