A
A
Alexander Ivanov2017-07-04 20:54:07
JavaScript
Alexander Ivanov, 2017-07-04 20:54:07

How to disable OWL slider on certain sizes?

I used to do now I can not find this option

owlProjects.owlCarousel({
    loop: true,
 	center: false,
 	nav: false,
 	navContainerClass: 'owl-navigation',
 	margin:0,
 	dots: false,
    slideBy:1,
    startPosition: 0,
 	responsive:{
     	0:{
     	    stagePadding: 50,
 	        margin: 10,
 			items:1
     	},
     	600:{
     	    rewind: false,
 	        callbacks: false
     	},
 	}
});

Although I remembered, it was at the first OWL that these guys had not patched this moment yet?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
Y
Yaroslav Rostanets, 2017-07-11
@cimonlebedev

Disable in the sense that there would be pictures simply?

$(window).resize(function(){
if($(window).width() > 768){
    owlProjects.trigger('destroy.owl.carousel');
}
});

S
scorpion11133, 2020-04-27
@scorpion11133

$(window).on('load resize', function () {
    if ($(this).width() > 768) {
      $(".slider").trigger('destroy.owl.carousel');
    } else {
      $(".slider").owlCarousel({
        items: 2,
      });
    }
  })

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question