ressio / lazy-load-xt

Lazy load XT is a jQuery plugin for images, videos and other media
http://ress.io/lazy-load-xt-jquery/
MIT License
1.36k stars 245 forks source link

Lazyload event not firing for video element #86

Open DanielleDeman opened 8 years ago

DanielleDeman commented 8 years ago

The 'lazyload' event does not seem to be firing for video elements. The class "lazy-loaded" is not added to any of my videos and the following code does nothing; $('video').on('lazyload', function(e){ console.log('load ' + e.target);});

Yet, when I do the same for images it works fine. Is this a known issue?

r3volution11 commented 6 years ago

I've noticed the same problem. It appears to only happen on the first video. .lazy-hidden isn't removed.

You can see the issue in the video demo.

hisnameisjimmy commented 6 years ago

I ended up using the changes presented in this pull request: https://github.com/ressio/lazy-load-xt/issues/29

I just added those changes to jquery.lazyloadxt.extra.js

It worked! It now removes lazy-hidden and adds lazy-loaded to video elements. Easy peasy.