A
A
Andrey Kuklin2017-09-07 10:31:08
JavaScript
Andrey Kuklin, 2017-09-07 10:31:08

Why doesn't owlCarousel scroll the slider by 1 item?

There are 3 elements in the slider, they change automatically by 1. When the 3rd slide becomes active automatically, 1 slide does not turn over. If you add loop: true , then new elements appear, but I don't need it.

$("#team__slider").owlCarousel({
        
          navText: ['<svg xmlns="http://www.w3.org/2000/svg" width="15" height="24"><path d="M2.8 0L0 2.8 9.3 12 0 21.2 2.8 24 15 12 2.8 0z"/></svg>','<svg xmlns="http://www.w3.org/2000/svg" width="15" height="24"><path d="M2.8 0L0 2.8 9.3 12 0 21.2 2.8 24 15 12 2.8 0z"/></svg>'],
          responsiveClass:true,
          loop:false,
          nav: true,
          dots: false,
          items: 1,
          autoplayTimeout:7000,
          autoplay:true
      });

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Andrey Kuklin, 2017-09-07
@Skrase

In short, for those who see this post. I figured out the second version =)
Here is the code:

var owl = $("#team__slider").on('initialized.owl.carousel changed.owl.carousel', function(e) {
  var carousel = e.relatedTarget;
  if ( carousel.current() + 1 === carousel.items().length) {
    setTimeout(function () {
      var dots = $('#team__slider .owl-dot');
      $(dots[0]).trigger('click');
    }, 7000);
  }
}).owlCarousel({
  navText: ['<svg xmlns="http://www.w3.org/2000/svg" width="15" height="24"><path d="M2.8 0L0 2.8 9.3 12 0 21.2 2.8 24 15 12 2.8 0z"/></svg>','<svg xmlns="http://www.w3.org/2000/svg" width="15" height="24"><path d="M2.8 0L0 2.8 9.3 12 0 21.2 2.8 24 15 12 2.8 0z"/></svg>'],
  responsiveClass:true,
  loop:false,
  nav: true,
  dots: true,
  items: 1,
  autoplayTimeout:7000,
  autoplay:true
});

M
Marty McFly, 2017-09-07
@alex_shevch

Because loop needs true + overflow hidden for the general block so that the additional elements are not visible.
Although it is generally strange, even with false, it should switch to the first one only by scrolling back..

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question