1

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?

  • You don't want responsive owl carousel ? – hweb87 May 23 '18 at 4:04
1

Try following code:

$('.owl-carousel').owlCarousel('destroy');
|improve this answer|||||
  • This code will work with latest owl version (from 2.1.6) – Wolf May 23 '18 at 3:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.