J
J
jenya77712017-02-02 14:06:46
JavaScript
jenya7771, 2017-02-02 14:06:46

Problem with slick slider?

Installed and connected the slider. But the site has switching between tabs and each tab has a slider, in the first tab after loading everything is displayed as it should, but when you switch to another tab, all the slides are shifted into a heap. How can I solve this problem, or advise a similar library with adaptive sliders, I found it myself but I need 3 slides initially on the screen.
54ac81a658b04940b6fde19c75d9f731.jpg

There should be slides in rectangles, but it turns out in a heap, but when you click on the arrows, everything is restored.

<div class="lic-slider" id="lic1">
     <div class="slider">
         <p>TEXT</p>
    </div>
     <div class="slider">
         <p>TEXT</p>
    </div>
     <div class="slider">
         <p>TEXT</p>
    </div>
     <div class="slider">
         <p>TEXT</p>
    </div>
</div>

and the code for launching the slider
$('#lic1').slick({
  dots: true,
  infinite: false,
  speed: 300,
  slidesToShow: 4,
  slidesToScroll: 1,
  responsive: [
    {
      breakpoint: 1024,
      settings: {
        slidesToShow: 3,
        slidesToScroll: 3,
        infinite: true,
        dots: true
      }
    },
    {
      breakpoint: 600,
      settings: {
        slidesToShow: 2,
        slidesToScroll: 2
      }
    },
    {
      breakpoint: 480,
      settings: {
        slidesToShow: 1,
        slidesToScroll: 1
      }
    }
    // You can unslick at a given breakpoint now by adding:
    // settings: "unslick"
    // instead of a settings object
  ]
});

the same for the rest of the tabs, only the id changes.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alina Brann, 2017-02-02
@alina_ivanovna

The problem is most likely that the inactive tab has a width or height of zero, try fixing

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question