Owl carousel does not work in response mode

I have an owl installation on the site - it works fine in desktop mode, but in mobile mode the slides seem to completely disappear.

My site is located at ypt.co.il (4 blocks under a large main slider - at first it looks in dekstop mode).

This is the plugin code:

    $('.owl-carousel').owlCarousel({
        loop:true,
        margin:27,
        nav:true,
        responsive:{
            0:{
                items:1
            },
            600:{
                items:3
            },
            992:{
                items:4
            }
        }
    });

Any input is appreciated!

+4
source share
1 answer

Your carousel is not configured on mobile devices due to lack of conditions. check your state in which you are callingres()

if(!$('.toggleMenu').is(':visible')){
  res();
}

If the condition gives false on the mobile phone and true on the desktop. This is why your carousel is not initialized.

, , res() pageload.

$(function () {
  res();
});

, -, js.

+3

Source: https://habr.com/ru/post/1667707/


All Articles