How to make infinity effect in slider using pure JS?

  • 0
    Hello, help with the task ...
    There is a slider for which you need to finish the normal infinity effect, now there is some kind of infinity effect there, but this is far from what you wanted to get, you just need to make an infinite scroll scroll of slides, as for example - Swiper JS or Slick. And the hardest thing of all is to save the indices (this.options.position), because they are already attached to dot navigation and, in general, to the translateX animation, something like that)

    I would be very grateful for any help.

    JavaScript Anonymous, Aug 28, 2019

  • 1 Answers
  • 0
    just like in other carousels - clone part of the slides. In this case, one first and put it at the end.

    after switching to the first slide (clone), scroll the panel to its initial state, but without animation, instantly.

    Cloned elements can be marked with attributes or classes.



    Why not take a ready-made slider?
    Fiona Morgan

Your Answer
To place the code, please use CodePen or similar tool. Thanks you!