I am trying to get image height after image has loaded. The reason for that is chrome gets false height values because it gets height before image has loaded.
var imgHeight = $("#pic25").height();
Note: I shouldn't use $(window).load(function(){
on this one.
How can I do that ?
var imageWidth = $(Imgsize). width(); alert(imageWidth);
Description. The Image Height is one part of the information that determines a picture's, photo's or other image's dimension. Together with the image width, this value determines the size of an image itself, not the file size. Often, Image Height is given in pixels, e.g. 682 px.
you need to use onload(.load()
) event since load event will be called only after the DOM and associated resources like images got loaded, so it work properly
$(body).load(function(){
var height = $("#pic25").height();
});
this would work
to check particular image to be load you can do this like @arvind answers code
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With