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

Question about 'lazy' and 'lazy-load-on-drag' #202

Open
julisch94 opened this issue Aug 11, 2023 · 0 comments
Open

Question about 'lazy' and 'lazy-load-on-drag' #202

julisch94 opened this issue Aug 11, 2023 · 0 comments

Comments

@julisch94
Copy link

Hey people! Amazing work on this library!

I have a question about the docs. There are two options regarding lazy loading:

lazy
Lazy loads each slide image when the slide becomes visible.
Lazy loading will be triggered in the before-slide hook for all the images of the slides becoming visible.

and

lazyLoadOnDrag
Lazy loads the next slide images while user is dragging towards that slide.
The load of the next slide image will be triggered in the before-slide hook.

I have experimented with both and I'm not sure I understand the difference.

Here's my specific questions:

  1. Docs say lazy loads images when the slide becomes visible. When is a slide considered 'visible'? Example: A user is on slide 1 and starts dragging to slide 2 but doesn't release. Instead the user goes back to slide 1 and releases. Then, slide 2 was technically visible - there was a blank space visible. But slide 2 should have been visible during that drag motion. However, the image of slide 2 was not loaded. Loading only starts when the user releases the drag on slide 2.

  2. With 'lazyLoadOnDrag' enabled, I would have expected the next slide to load once the user starts dragging. However, I can read that it's triggered when before-slide is fired and by using a @beforeSlide logger, I found out that before-slide is only fired when the user, again, releases the drag motion. So also lazyLoadOnDrag doesn't load when the user starts dragging.

  3. Is there a way that I can start lazy loading the next slide once the user starts dragging? Or, on desktop, when the user hovers over the arrow? So far, all the options seem to start loading the image when the user releases the drag.

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