I have create an owl carousel with code below
$('.owl-carousel').owlCarousel({
"items" : 1,
"responsive": false,
"autoPlay": 2000,
"loop": false,
"rewind": false,
"nav": true,
"navText": ["<", ">"],
"dots": true
});
and this is output html:
<div class="owl-carousel">
<div class="owl-wrapper-outer">
<div class="owl-wrapper">
<div class="owl-item"></div>
<div class="owl-item"></div>
<div class="owl-item"></div>
</div>
</div>
</div>
when I change to mobile mode. I destroy the owl carousel with code below:
$('.owl-carousel').trigger('destroy.owl.carousel');
But it is not destroy. Is there any wrong in my code? or what is the correct way to destroy owl carousel?
Best Answer
Try following code: