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

How can I make this work with background images? #65

Closed
notatamas opened this issue Oct 24, 2018 · 2 comments
Closed

How can I make this work with background images? #65

notatamas opened this issue Oct 24, 2018 · 2 comments
Assignees

Comments

@notatamas
Copy link

The dependency of this plugin works with background images as well.
I tried data-lazy-src and data-bg-src but none of them worked.

@remyperona
Copy link
Contributor

For now it's not supported in the plugin. We could add a first step with a filter on the elements, so you can set your own class to detect a div with a background image.

@remyperona
Copy link
Contributor

With version 2.0

The element you want to apply lazyload on must have this specific markup:

<div class="rocket-lazyload-bg" data-bg="url(../img/image.jpg)"></div>

The element must have the class rocket-lazyload-bg, and a data-bg attribute, which value is the CSS url for the image.

@remyperona remyperona self-assigned this Jan 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants