dinbror / blazy

Hey, be lazy! bLazy.JS is a lightweight pure JavaScript script for lazy loading and multi-serving images. It's working in all modern browsers including IE7+.

Home Page:http://dinbror.dk/blazy

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Doesn't trigger when needed

joshribakoff opened this issue · comments

Excellent plugin, found an issue though...

1 - resize browser really small, so only 1-2 images are visible
2 - open a new tab & goto google
3 - maximize browser
4 - go back to original tab

Actual results - since the browser is now bigger, more images are shown, but blazy doesn't detect that more images are now visible. Although scrolling at least 1px triggers them to load

Expected results - blazy should not only fire on scroll event, but on browser resize, or when a tab becomes active (or at least fire an interval every few seconds to compare the current browser size to the last known size)

Seconded.

Triggering on page visibility doesn't seem to be that well supported (http://stackoverflow.com/a/12186061/273406) and firing intervals continously isn't optimal. Although it seems Blazy is already triggering on window resize.

Fixed in v. 1.2.2. Thanks for reporting

Thanks I applied the patch from ae11c6b and I can confirm it solves the issue. Greatly appreciated! FYI you can mention the issue number (15) following the hash sign (#) in your commit message, which will place a link from the issue on GitHub to the changeset, which makes it easier for people to find patches when viewing the issue on GitHub :)