I have a parent page where I have a block of the list and in each list, I have images where on the image div I have implemented Owl Carousel and it is working fine.On each list the there is a button on clicking the button a modal will open and I want to implement Owl Carouse there but in the modal Owl carousel is not working as expected.
In main page I have implement Owl like this
$(".owl-carousel").owlCarousel({
loop: false,
autoPlay: false,
stopOnHover: false,
navigation: true,
pagination: false,
paginationNumbers: false,
responsiveClass: true,
//loop: true,
//margin: 10,
//nav: true,
responsive: {
0: {
items: 2
},
600: {
items: 2
},
1000: {
items: 3
},
1360: {
items: 3
}
}
});
And in Modal I have implemented Owl like this
$('#package-details').on('shown.bs.modal',
function () {
debugger;
$("#pckg-app-list").owlCarousel({
loop: false,
autoPlay: false,
stopOnHover: false,
navigation: true,
pagination: false,
paginationNumbers: false,
responsiveClass: true,
responsive: {
0: {
items: 2
},
600: {
items: 2
},
1000: {
items: 3
},
1360: {
items: 3
}
}
});
});
In modal Owl is generated this way in HTML which is wrong because there is no outer elemnt applying.
<div class="owl-carousel owl-theme yesscroll px-0 owl-loaded owl-drag" id="pckg-app-list"><div class="item"> <img class="owlimage" src="https://appsdrive.blob.core.windows.net/applogos/aeb6cee7-3951-4fe6-af63-f656b2a8bdb9_SAp-business-one.png"> </div><div class="item"> <img class="owlimage" src="https://appsdrive.blob.core.windows.net/applogos/3334f37d-bd1e-419a-89bc-28544ddb4e8c_magento.png"> </div></div>