How does Google Image search can tell the dimensions of image before it loads?

51 Views Asked by At

When you search for images for a topic on Google, grayed out image containers load up in the dimension of images before images load.

I am trying to implement the same feature on my website, but I don't know how to get the width and height of image before they load.

1

There are 1 best solutions below

0
On

So, I hope I understand you in loading of the image dimension on your website. Basically you can implement it in your style sheets or java script, or even with a simple mouseover in html of each image. Google uses class="rg_ilmn" as their style for the picture. Here is a link to a similar explanation about Displaying Image Dimensions. Hope this helps.