blueimp / Gallery

blueimp Gallery is a touch-enabled, responsive and customizable image & video gallery, carousel and lightbox, optimized for both mobile and desktop web browsers. It features swipe, mouse and keyboard navigation, transition effects, slideshow functionality, fullscreen support and on-demand content loading.
https://blueimp.github.io/Gallery/
Other
3.75k stars 983 forks source link

Allow 2 slides to display continuous #192

Closed andrejsstepanovs closed 9 years ago

andrejsstepanovs commented 9 years ago

This merge request will allow to continuously loop 2 slides.

I totally understand reasoning behind not allowing to loop through one image (slide). But this logic don't apply for 2 images. You actually can and, in my case, need to loop them.

Overall this functionality about not allowing to loop 2 images is actually a feature that needs to be moved into configuration parameter (example: this.options.minSlideCountToLoop = 2)

blueimp commented 9 years ago

Enabling continuous slide for two items will require to clone one of the items, as you need a next item on each slide direction. That's why disabling continuous slide for less than 3 makes sense, as cloning won't always be desired and also requires more code.