rcbyr / keen-slider

The HTML touch slider carousel with the most native feeling you will get.

Home Page:https://keen-slider.io/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Easy slider with dynamic content, arrows and dots

momorigo opened this issue · comments

Thank you for this very useful library!

I want to create a dynamic slider containing a variable number of elements, displaying two elements at a time, all with arrows
and dots. I'm using vanilla JS. So I've tried to mix between the "arrows and dots" and "dynamic content" examples available on the website :
https://codesandbox.io/s/github/rcbyr/keen-slider-sandboxes/tree/v6/navigation-controls/arrows-and-dots/javascript?file=/index.html
https://codesandbox.io/s/github/rcbyr/keen-slider-sandboxes/tree/v6/media/dynamic-content/javascript?file=/index.html

The problem is that I can't get dots and arrows to work dynamically. I suppose it might be just a simple trick with the "detailsChanged" event but I can't find it... Thanks for your help!

Here's my code: https://codesandbox.io/s/keen-slider-dynamic-content-with-dynamic-arrows-and-dots-cyfy4p?file=/index.html

PS: it's less important but by the way, is it possible to generate a dot not per element but according to "perView" (or anything equivalent) in order to slide the elements 2 by 2? If yes, how?