2
I want to destroy all my sliders when the page hit the size of 768px. For this I made this code below:
if($(window).width() >= 768){
$(".owl-carousel-linhas").data('owlCarousel').destroy();
}
I have on my page several sliders so:
<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 destroys only the first slider, the rest not.
I’ve tried that. But as he destroys the first, he can’t find the second... that’s what it looks like. I’ll simulate the error to show you.
Uncaught TypeError: e.data is not a function
.– Diego Souza