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

Doesn't work inside iframe #439

Open
Eschon opened this issue Aug 9, 2019 · 1 comment
Open

Doesn't work inside iframe #439

Eschon opened this issue Aug 9, 2019 · 1 comment

Comments

@Eschon
Copy link

Eschon commented Aug 9, 2019

Lazy loading images using the library works without problems, but when i include my page in another page inside an iframe it suddenly stops working. I have a bunch of images that have the data-src attribute and I just call lazyload after adding them to the page

new Lazyload(null, {
  rootMargin: '100px',
});

I also tried setting a root element for the intersection observer but without success.

I'm not sure if this is a problem with the library or with the intersection observer. The MDN page mentions something about iframes but I've read that paragraph 3 times now and I just don't get it 😅

@rotate4all
Copy link

Couldn't reproduce your report. As per my tests it worked exactly as expected even through an iframe.
Make sure you're loading the plugin on the same page (the one inside the iframe) and not on the parent page.

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

No branches or pull requests

2 participants