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

feat: loadPrevNext module - preloading images #6416

Closed
wants to merge 2 commits into from

Conversation

Carnoisseur1979
Copy link
Contributor

This implements a loadPrevNext module, to preload next and/or previous images when lazy loading, by a specified amount.

This replaces the functionality lost when the lazy module was removed in v9. See discussion #6350 .

@nolimits4web
Copy link
Owner

Thanks!

I think this shouldn't be a module, but part of the core.

@Carnoisseur1979
Copy link
Contributor Author

Thanks!

I think this shouldn't be a module, but part of the core.

* `unlazy` and `preload` functions can go here https://github.com/nolimits4web/swiper/blob/master/src/shared/process-lazy-preloader.js

* core parameter `lazyPreloadPrevNext` that accepts number (default is 0)

* instead of hooking into `init` and `slideChange` events just call `preload` into the places these events are emitted

I agree - as soon as I posted this I had second thoughts about it being a module!
I was also thinking that it should account for rewind mode - looping round when needed.

I'll have a go in another PR.

@Carnoisseur1979
Copy link
Contributor Author

@nolimits4web see second attempt, as part of the core, in #6544

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