Jquery 如何销毁具有多个div的Owl carousel类
如何销毁具有多个div的Owl carousel类。当切换到移动模式时,我必须销毁,当桌面模式更改时,我必须再次初始化??请有人帮帮我Jquery 如何销毁具有多个div的Owl carousel类,jquery,owl-carousel,Jquery,Owl Carousel,如何销毁具有多个div的Owl carousel类。当切换到移动模式时,我必须销毁,当桌面模式更改时,我必须再次初始化??请有人帮帮我 function resizeWindow() { if ($(window).width() <= 600) { $("#options-list").owlCarousel({ loop: true, //options-list-owl- items: 3, pag
function resizeWindow() {
if ($(window).width() <= 600) {
$("#options-list").owlCarousel({
loop: true, //options-list-owl-
items: 3,
pagination: false,
});
if (typeof $(".product-list").data('owlCarousel') !== 'undefined') {
$(".product-list").data('owlCarousel').destroy();
}
} else {
$(".product-list").owlCarousel({
loop: true, //product-list-owl-
items: 3,
itemsDesktop: [1024, 3],
pagination: false,
});
if (typeof $("#options-list").data('owlCarousel') !== 'undefined')
$("#options-list").data('owlCarousel').destroy();
}
}
函数大小调整窗口(){
如果($(window).width()我认为您销毁owlCarousel的方法不正确。请尝试$(“#产品列表”).owlCarousel('destroy');
但我需要删除多个div的类,这是什么意思?我有多个div来初始化同一个owlCarousel..所以我在这里使用class来销毁所有owlCarousel类的过程是什么