Images no longer lazy load after 1.8.0 #113

Closed
dbirkbeck opened this Issue Oct 22, 2016 · 1 comment

Projects

None yet

2 participants

@dbirkbeck

If a container extends outside of the view range, all images within the container (including images outside of the viewport) are now loaded. To fix this, the container must be bounded by the viewport (plus offset). I'm new to GitHub so I'll post the fix in this message below as well as try to submit a pull request.

                var containerRectWithOffset = {
                    top: ((containerRect.top - options.offset) < _viewport.top) ? containerRect.top - options.offset : _viewport.top,
                    right: ((containerRect.right + options.offset) > _viewport.right) ? containerRect.right + options.offset : _viewport.right,
                    bottom: ((containerRect.bottom + options.offset) < _viewport.bottom) ? containerRect.bottom + options.offset : _viewport.bottom,
                    left: ((containerRect.left - options.offset) < _viewport.left) ? containerRect.left - options.offset : _viewport.left
                };
@dinbror
Owner
dinbror commented Oct 25, 2016

Thanks @dbirkbeck - Released in v.1.8.2. Some of your chevrons were wrong

@dinbror dinbror closed this Oct 25, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment