Photo Browser Loop

I would like to loop (return to slide 1 after the last slide) when manually browsing the Photo Browser. I can’t use the “swiper” options as it starts automatically switching slides. Using F7 v4.4.

you can use reachEnd evt
reachEnd Event will be fired when Swiper reach last slide

and then slideTo method

mySwiper.slideTo(index, speed, runCallbacks); Run transition to the slide with index number equal to 'index' parameter for the duration equal to 'speed' parameter.

* index - number - index number of slide
* speed - number - transition duration (in ms).  *Optional*
* runCallbacks - boolean - Set it to  `false`  (by default it is  `true` ) and transition will not produce transition events.  *Optional*

didnt test it but it should work;
here is the doc:

http://idangero.us/swiper/api/

It should work using the loop: true option as shown in this example (The example works):

However, if I initialize the PhotoBrowser with:

var photoBrowser = app.photoBrowser.create({
    photos : photosUrl,
    swiper: {
        loop: true
    }
});

it goes crazy:

  • Starts at slide #2 if I click photo #1.
  • When I slide to the next photo, it works. However, by the time I get to photo 3 or 4, it keeps showing me photo 3 or 4 on next slide.

If I set loop: false, it it still broken. However, initializing the photo browser as below works (without looping):

var photoBrowser = app.photoBrowser.create({
    photos : photosUrl
});

I think adding the “swiper” options to the photo browser is buggy.

Disable virtualSlides parameter, it doesn’t compatible with loop:

var photoBrowser = app.photoBrowser.create({
    photos : photosUrl,
    virtualSlides: false,
    swiper: {
        loop: true
    }
});
1 Like