Skip to content

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

@julisch94

Description

@julisch94

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions