React-id-swiper: loadOnTransitionStart doesn't work

Created on 8 Feb 2018  路  9Comments  路  Source: kidjp85/react-id-swiper

const params = { pagination: { el: '.swiper-pagination', type: 'bullets', clickable: true, dynamicBullets: true }, slidesPerView: 1, loop: true, preloadImages: false, lazy: { enabled: true, loadOnTransitionStart: true } };

We need the image to start loading as soon as the swipe begins rather than waiting for the blur event. This property doesn't seem to be working however! Still only lazy loads on blur.

help wanted

Most helpful comment

Hi @joe-f , sorry for my late reply cause I am so busy recently. I found one solution for u.

params = {
    lazy: {
       loadPrevNext: true,
       loadPrevNextAmount: 1,  // number of slides u wanna preload on transition start
       loadOnTransitionStart: true
   }
}

All 9 comments

@kidjp85 Any ideas on this issue?

Hi @joe-f , sorry for my late reply. It should not have enabled property in lazy params due to API. Only lazy: { loadOnTransitionStart: true } is enough

Hey @kidjp85 thanks for the update!

I've tried this, and it does lazy load but it has the exact same effect as normal lazy loading. e.g. The image is loaded on release of the swipe

This should load the image as soon as the swipe begins, but it isn't.

Hi @joe-f , how do u check if it has the exact same effect as normal lazy loading ? Is it still showing loading spinner ? Cause when I tested in my local with demo page, I couldn't see loading spinner when I went to next slide.

Hey @kidjp85,

No loading spinner, but this property should load the next image as soon as you start swiping, even before you release the swipe, but it isn't

Here is what is happening:
2018-02-20 14 06 18

@kidjp85 Did you get a chance to look at the above animation, showing the problem?

Hi @joe-f , sorry for my late reply cause I am so busy recently. I found one solution for u.

params = {
    lazy: {
       loadPrevNext: true,
       loadPrevNextAmount: 1,  // number of slides u wanna preload on transition start
       loadOnTransitionStart: true
   }
}

@kidjp85 Perfect that fixed it, thank you!

Actually, it doesn't. @kidjp85 's solution just do this:

  • when you start transition to next slide, swiper loads content on left and right sides of this slide, instead of loading content on left and right sides only if transition is ended.

But issue question relates to another possibility: lazy load slide image only when user tries to swipe to this slide.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Sallywa picture Sallywa  路  5Comments

catamphetamine picture catamphetamine  路  5Comments

trevans24 picture trevans24  路  6Comments

mbenjrinija picture mbenjrinija  路  4Comments

jamland picture jamland  路  3Comments