I use Owl-carousel 2. I use standard code of initialization and markup of Owl-carousel 2. At the first load of page the work of carousel is perfect. Owl-carousel 2 stop the work when I pass in browser to another page and back or minimize browser and again open page with Owl-carousel 2. New start of carousel when I again click navigation. I had try to place in body of html code of initialization of carousel again:
var $carousel = $('.owl-carousel');
var owl = $carousel.data('owlCarousel');
owl.trigger("refresh.owl.carousel");
But it is not working. Autoplay need to run but it is not working. How I can correct this problem? Thanks
I know this question is rather old, but since it has no answer yet, and the issue is still present in Owl Carousel 2.2.1
, here's a simple solution that may hopefully help someone:
Try using the beta build of Owl Carousel, you can get it here. Just grab the owl.carousel.js
or owl.carousel.min.js
file and replace the one you're using currently with it. At
the moment of this writing the current beta build is 2.3.0. I can
confirm that this build fixed the issue for me.
The issue is a known bug. The discussion in the issue tracker provides more insight into what causes it, so you could use it to modify your existing owl.carousel.js
to incorporate your own fix if you don't feel like using beta builds.