I need to get the Width and Height of a img tag, when it’s replaced by javascript.
I tried using jQuery’s width() / height() but always return the values of the cached image, and not the ones of the new image.
I need that because i have a function to scale the background-size of a div depending on size of the image loaded.
I searched a lot on google and here but can’t find a solution.
To get the dimension of image try this :