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

Lazy not loading in background browser tabs #232

Closed cjholowatyj closed 4 years ago

cjholowatyj commented 4 years ago

Hey Daniel! I love this jQuery plugin! I'm having trouble though, with Lazy() not firing if the page is loaded in the background while another tab is open... When I click on a tab that has loaded in the background, lazy images don't load. I tried $(window).focus(function(){$('.lazy').Lazy({bind:"event",delay:0});}); but it doesn't seem to work. Any suggestions? (FYI, using the picture tag plugin)

cjholowatyj commented 4 years ago

Please disregard this issue. Discovered that I was targeting the wrong element with .Lazy() I was targeting the <img> tag instead of the <picture> tag by accident