Owl carousel customize page preview image not working
I watch this neat creation by Yunus Gaziev, but there is one major problem: the pagination is removed as soon as you customize the viewport, which appears to be caused by Owl and I don't know why.
var owl;
$(document).ready(function() {
owl = $("#owl-demo");
owl.owlCarousel({
navigation: false,
slideSpeed: 300,
paginationSpeed: 400,
singleItem: true,
afterInit: afterOWLinit
});
function afterOWLinit() {
...
}
});
source to share
The problem was that the initializer owlCarousel
had to have been afterUpdate: afterOWLinit
declared in such a way that whenever the viewport was resized it would re-activate the custom pagination script.
I completely reworked the existing code, an example can be viewed here - my version can be cloned from here .
source to share
I tried to debug javascript but couldn't find the reason. I think this pagination is not being recreated when changing the viewport toowl.carousel.js
Here he tries to recreate the pagination
-
base.updatePagination();
-
base.checkNavigation();
Check it. I hope this helps you and others find the root cause.
source to share