D
D
DeniSidorenko2019-01-15 20:20:06
JavaScript
DeniSidorenko, 2019-01-15 20:20:06

Owl Carousel, how to get the slide into a variable at the end of the movement?

There is a slider for 12 items. , shows by 4. I.e. 4 of them are active. How can I get the element that is the first in the list with the active class when scrolling (with the mouse or arrows)?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
0
0xD34F, 2019-01-15
@DeniSidorenko

onTranslated() {
  const $firstActive = this.$element.find('.owl-item.active:eq(0)');
},

or
.on('translated.owl.carousel', function() {
  const $firstActive = $(this).find('.owl-item.active:eq(0)');
})

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question