M
M
Mariana Marianova2019-09-10 09:57:23
JavaScript
Mariana Marianova, 2019-09-10 09:57:23

How to update owl carousel inside Tabs UI when connecting tabs?

There is a customized owl carousel slider. Located inside the TABS UI tabs. The slider is adaptive, the required number of slides is configured for each resolution

//подключение табов
$("#tabs").tabs();

//подключение карусели
$(".owl-carousel").owlCarousel({
                loop:false,
                nav:false,
                dots: true,
                responsive:{
                     //с 1920 до 768
                    768:{
                        items:4
                    },
                     //с 768 до 575
                    575:{
                        items:3
                    },
                    //до с 575 до 399
                    399:{
                        items:2
                    },
                     //с 399 до 0
                    0:{
                        items:1
                    }
                }
            });

At a resolution of 399, the number of slides becomes equal to 1 only when switching tabs, but simply when the page is refreshed, 2 slides are shown.
How to make sure that the correct number of slides is shown when the page is refreshed, namely, that at a resolution of 399 there is 1 slide

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry Arushanov, 2019-09-10
@daruwanov

Try to replace

399:{
                        items:2
                    },

on the
400:{
                        items:2
                    },

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question