D
D
Denis Bukreev2017-10-02 04:26:29
JavaScript
Denis Bukreev, 2017-10-02 04:26:29

Is it possible to make infinite scroll in owl.carousel 2 like in owl.carousel 1?

So it goes.
The slider cannot operate on clones, and in the second version of owl.carousel, infinite scrolling is done using cloning.
In the first version, as far as I remember, the slider simply scrolled back to the first slide if it reached the end.
Is it possible to do this in the second version?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Denis Bukreev, 2017-10-02
@denisbookreev

With the help of the 'to.owl.carousel' trigger, I was able to achieve the desired effect

// если слайд последний
if ( $('.owl-item.active').index() === $('.owl-item').length - 1 ) {
  it.carousel.trigger('to.owl.carousel', [0, 200]);
}

the same can be done in reverse

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question