0

I have implemented lozad.js in one of my project but images getting load in multiple chunk loading which looks very odd,

Sometimes it load half image and then 1/3 image and then full, which look very bad on website

so i just wanted to load images smoothly, which will help to great User Experience

i have tried fade in but that makes my image hide, here is the below code

lozad('.lozad', {
    load: function(el) {
        el.src = el.dataset.src;
        el.onload = function() {
            el.classList.add('fade')
        }
    }
}).observe()
1
  • Did you add the correct .fade CSS class ? Commented Oct 13, 2023 at 12:09

0