Lazy load images in slider (and elsewhere too)
PlannedTo improve load time, please set slider images to lazy load (it would also be helpful if you set all images to lazy load). Two easy ways to do this:
- On the <img> tag, set loading="lazy" (quick and easy though maybe not supported by all browsers)
- Set <img> src="" and and include a data-src="/path/to/image". Then, when the image comes into view use Javascript to set the src="" to be equal to data-src="/path/to/image". Images don't load until their src attribute is set.
4
Please sign in to leave a comment.
Comments
0 comments