dkern / jquery.lazy

A lightweight, fast, feature-rich, powerful and highly configurable delayed content, image and background lazy loading plugin for jQuery & Zepto.
http://jquery.eisbehr.de/lazy
Other
1.02k stars 236 forks source link

Images loading twice #272

Closed mikeott closed 1 year ago

mikeott commented 1 year ago

While looking at the Network tab of the element inspector, as images with the 'lazy' class come into view they each get loaded twice. Replicated in latest versions of Chrome and Firefox.

I've confirmed this happens with jpg images as well.

My js:

`jQuery(function(jQuery) {
    jQuery('.lazy').lazy({
        effect: 'fadeIn',
        effectTime: 500,
        threshold: 0,
    });
    jQuery('iframe[data-src]').lazy();
});`

Reducing it to just this...

`jQuery(function() {
    jQuery('.lazy').lazy();
});`    

...doesn't change anything.

We've been using this script without any drama for a long time, and this is the first time I've seen this behaviour.

dkern commented 1 year ago

There are multiple issues describing this. Just search for "twice". ;)

mikeott commented 1 year ago

@dkern Props - and I feel stupid for not checking that first. Feel free to delete this as you are correct the issue has been well documented already.