Glide: Problem when perView is larger than Slide-Amount

Created on 8 Aug 2019  路  1Comment  路  Source: glidejs/glide

I've got a very simple slideshow using this code:
new Glide(".detailslider-thumbs", { startAt: 0, perView: 6, bound: true }).mount()

But in some cases the Slideshow contains less than 6 Slides. This doesnt seem to work, as I am still able to swipe through it, and somehow chaning the alignment from LTR to RTL...

When I remove the bound-Option, I no longer have that problem, but I am able to scroll through the slides, until the last one is at position 0 which is not what I want either.

Most helpful comment

I came up with this problem too so as a workaround, I set perView by counting the number of slides I had.

let numOfSlides = jQuery(element).find('.glide__slides').children('li'); 
perView: numOfSlides.length > 8 ? 8 : numOfSlides.length

>All comments

I came up with this problem too so as a workaround, I set perView by counting the number of slides I had.

let numOfSlides = jQuery(element).find('.glide__slides').children('li'); 
perView: numOfSlides.length > 8 ? 8 : numOfSlides.length
Was this page helpful?
0 / 5 - 0 ratings