D
D
Dmitry2016-07-27 14:27:54
Owl Carousel
Dmitry, 2016-07-27 14:27:54

How to count the number of pages of owl corusel 2 slides?

var owl = $('.b-sale__action');
owl.owlCarousel({
  items : 4,
  slideBy: 4,
  loop: true,
  onInitialized: function(e) {
    $('.counter-out').text('1 / ' + this.items().length)
    console.log();
  }
});
owl.on('changed.owl.carousel', function(e) {
  $('.counter-out').text(++e.page.index  + ' / ' + e.page.count)
});

I'm using a script to count slides for owl corusel 2. But here's the problem: I can't display the number of slide screens (number of groups of 4 slides) into this.items().length variable. How to count the number of slide groups and not all slides?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question