Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stop loading img in display:none #83

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

h2owl
Copy link

@h2owl h2owl commented Oct 25, 2017

Hi, dear

This PR stops loading img which is not displayed ( display:none ).
The function getBoundingClientRect, which is used in inViewport can't take correct position when the node is in invisible element, can it?
So I added a check in inViewport to know whether it's displayed.
Please tell me if I did anything wrong.
Thanks.

best regards,

h2owl added 2 commits October 25, 2017 12:08
when layzr checks "getBoundingClientRect", element which is nod displayed returns 0 as getBoundingClientRect().top
@Stolzenhain
Copy link

+1 for this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants