如何破坏有多个div的Owl-carousel类

时间:2017-07-03 10:15:04

标签: jquery owl-carousel

如何破坏拥有多个div的Owl-carousel类。我必须在更改为移动模式时销毁,并在桌面模式更改时再次初始化?请有人帮帮我..

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();


  }
}

0 个答案:

没有答案