how to set width and height for data-src?

2.9k Views Asked by At

Hi I tried to set lazy loading of images in shopping website. Everything worked fine but when it comes for loading image that in "data-src" I find it difficult to set width and height for image inside data-src. Kindly help me with how to set height and width.

<img data-src="image/apple_600x450.jpg" src="img/loader.gif" style="width:100px; height:100px;" >

the above style works only for image inside src but it has no effect of data-src. Kindly help me to set

max-width
max-height
width
height

for image inside data-src.

Thanks in advance.

1

There are 1 best solutions below

0
On

Bootstrap uses data-src instead of src, it's because of the plugin holder.js. data-src is only used for the javascript library that generates the example images of a certain size, and src is the normal attribute for specifying the location of an image. See the holder.js documentation here.