A
A
Alexander Nameless082019-09-06 10:06:51
JavaScript
Alexander Nameless08, 2019-09-06 10:06:51

How to scroll owl slider to a specific slide?

Hello!

After the completion of the pjax request, I reinitialize the owl slider and want to scroll to a specific slide, the code looks like this:

$(document).on('pjax:end', function() {

     	$('#navTabsScheduleDays').owlCarousel({
          loop: false,
          nav: true,
          responsive:{
              0:{
                  items:2
              },
              380 : {
              	items:3
              },
              480 : {
              	items:4
              },
              600: {
              	items:5
              },
              800:{
                  items:7
              },
              1000:{
                  items:10
              }
          },

          onInitialized : function(event){
          	$('#navTabsScheduleDays').trigger('to.owl.carousel', 10);
          }

      });

    });


But for some reason it doesn't scroll.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey Sarkisyants, 2019-09-08
@Nameless08

The startPosition option wo n't solve the problem? Or do you need to scroll?
https://owlcarousel2.github.io/OwlCarousel2/docs/a...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question