I want to destroy all my sliders when the page hits the size of 768px. For this I made this code below:
if($(window).width() >= 768){
$(".owl-carousel-linhas").data('owlCarousel').destroy();
}
I have several sliders on my page like this:
<div class="owl-carousel-linhas">
<div class="item"></div>
<div class="item"></div>
<div class="item"></div>
<div class="item"></div>
</div>
<div class="owl-carousel-linhas">
<div class="item"></div>
<div class="item"></div>
</div>
<div class="owl-carousel-linhas">
<div class="item"></div>
<div class="item"></div>
<div class="item"></div>
<div class="item"></div>
</div>
And the code I made above only destroys the first slider, the rest does not.