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

LazyLoad on multiple elements with both default and non-default sources and attributes #106

Open
niklasquitzau opened this issue Mar 28, 2017 · 0 comments

Comments

@niklasquitzau
Copy link

I am using LazyLoad XT to load default <img>s and it's working just fine using

$.extend($.lazyLoadXT, {
    selector: 'img',
    srcAttr: 'src',
});

I am using the srcAttr: 'src' due to compatibility with a third party plugin which requires the default src. However, I have several divs with a background-image that I would like to Lazy Load. My question is; how do configure the plugin to also target a div with fx .someClass to lazy load the background-image with the default attr data-bg? I've tried several different variations which always seem to cancel the other one out. So the back-ground image will work but then not the <img> etc. Furthermore I have an HTML5 video running that I would like to lazy load but with the default src instead of data-src.

Basically, I would like to know how to define each element that I would like to lazyload, based on fx class, and also the src attribute whether it's the lazyload default or the html default.

Sorry for the noob question, hope someone can help.

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

1 participant