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

expand modification after init #581

Closed
tomasmozeris opened this issue Jan 11, 2019 · 3 comments
Closed

expand modification after init #581

tomasmozeris opened this issue Jan 11, 2019 · 3 comments

Comments

@tomasmozeris
Copy link

Hey, thanks for great library!

I would like not lazyload off screen images until first user action, my config contains:
lazySizes.cfg.expand = 1
On first user action I'm changing expand value:
lazySizes.cfg.expand = 500
However preloadExpand has been already set and this config modification has no effect so I end up commenting statement:
if(preloadExpand == null)
Any chances in future release config modifications would be taking into account after init?

@aFarkas
Copy link
Owner

aFarkas commented Jan 11, 2019

This is basically already done by lazySizes.cfg.loadMode. Simply set it to 1 initially.

@aFarkas aFarkas closed this as completed Jan 11, 2019
@tomasmozeris
Copy link
Author

With loadMode: 1 bellow the fold images is loaded after load event. Lets say 90% of my users clicks CTA on hero image, so I'm waisting their bandwidth. I guess I could play around with data-expand and after first scroll modify attribute or loader.unveil images I wish, but still I believe modifying expand after init would be useful.

Sorry for bothering with minor things, I'll see if I can find meaningful solution and PR it

@aFarkas
Copy link
Owner

aFarkas commented Jan 12, 2019

I see the general usefulness of being able to change the expand option dynamically so I have changed it. But to be honest in your case it is probably just some kind of premature optimization.

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