Моя сова-карусель, показывающая только первое изображение, но не показывающая других - PullRequest
0 голосов
/ 13 января 2019

Я использую пользовательский jquery, чтобы сделать OWL-карусель такой: Карусель Custom

Но он загружает только первое изображение. здесь

код:

  jQuery(document).ready(function(){
function init_carousel_owl(){
  $('.init-carousel-owl').each(function(){
    var items = $(this).data('items') ? $(this).data('items') : 5;
    var items_lg = $(this).data('items_lg') ? $(this).data('items_lg') : 4;
    var items_md = $(this).data('items_md') ? $(this).data('items_md') : 3;
    var items_sm = $(this).data('items_sm') ? $(this).data('items_sm') : 2;
    var items_xs = $(this).data('items_xs') ? $(this).data('items_xs') : 1;
    var loop = $(this).data('loop') ? $(this).data('loop') : false;
    var speed = $(this).data('speed') ? $(this).data('speed') : 200;
    var auto_play = $(this).data('auto_play') ? $(this).data('auto_play') : false;
    var auto_play_speed = $(this).data('auto_play_speed') ? $(this).data('auto_play_speed') : false;
    var auto_play_timeout = $(this).data('auto_play_timeout') ? $(this).data('auto_play_timeout') : 1000;
    var auto_play_hover = $(this).data('auto_play_hover') ? $(this).data('auto_play_hover') : false;
    var navigation = $(this).data('navigation') ? $(this).data('navigation') : false;
    var rewind_nav = $(this).data('rewind_nav') ? $(this).data('rewind_nav') : false;
    var pagination = $(this).data('pagination') ? $(this).data('pagination') : false;
    var mouse_drag = $(this).data('mouse_drag') ? $(this).data('mouse_drag') : false;
    var touch_drag = $(this).data('touch_drag') ? $(this).data('touch_drag') : false;

    $(this).owlCarousel({
        nav: navigation,
        autoplay: auto_play,
        autoplayTimeout: auto_play_timeout,
        autoplaySpeed: auto_play_speed,
        autoplayHoverPause: auto_play_hover,
        navText: [ '<i class="gv-icon-164"></i>', '<i class="gv-icon-165"></i>' ],
        autoHeight: false,
        loop: loop, 
        dots: pagination,
        rewind: rewind_nav,
        smartSpeed: speed,
        mouseDrag: mouse_drag,
        touchDrag: touch_drag,
        responsive : {
            0 : {
              items: 1,
              nav: false
            },
            580 : {
              items : items_xs,
              nav: false
            },
            768 : {
              items : items_sm,
              nav: false
            },
            992: {
              items : items_md
            },
            1200: {
              items: items_lg
            },
            1400: {
              items: items
            }
        }
    }); 
  }); 
}init_carousel_owl(); 

Но в консоли я обнаружил, что все изображения загружаются. Но он не показывает мою домашнюю страницу. Как я могу решить эту проблему? Это проблема с этим jquery?

...