I know in the first version of owl carousel we do it like this :
var $carousel = $('#carousel');
var owl = $carousel.data('owlCarousel');
owl.reinit({touchDrag: false, mouseDrag: false;});
Ok, but how we do it in the second version, i don't know how they renamed it.
Now, you can destroy it like that:
For some reasons $('#your_carousel').trigger('destroy.owl.carousel') is not working correctly. it does not remove all classes which are needed to reinit the plugin again.
You'll need to remove them completely to destroy the "owl carousel 2". like described here in this issue on github: https://github.com/smashingboxes/OwlCarousel2/issues/460
To destroy the owl function use:
This worked perfect for me:
If use v1.3 I make next
It's work for me.
You can do that with
destroy
but you have to use latestdevelop
branch:Or with direct access to the plugin:
This definitly works:
And the plugin itself:
in Owl.prototype.destroy = function()
I am not sure, have you tried the replace?
As per the OwlCarousel documentation, listed here http://www.owlcarousel.owlgraphic.com/docs/api-events.html, the event to trigger is "replace.owl.carousel". You can implement it like this :
Hope that helps!