V
V
Vashka12020-03-20 17:49:00
JavaScript
Vashka1, 2020-03-20 17:49:00

In popup(fancybox), there are slides made in slick slider. Slides stick together when calling popup, how to fix it?

Hello. I described the essence in the title, there is a popup, and there is a slider in it. When called, it sticks together, but when scrolling, it is restored. I attached the slider call, followed by the fancybox call.

$(".gooodPopup__slider").not('.slick-initialized').slick({
  slidesToShow: 1,
  slidesToScroll:1,
  dots: false,
  swipe:true,
  infinite:true,
  asNavFor: '.gooodPopup__dots',
});
$('.gooodPopup__dots').not('.slick-initialized').slick({
  slidesToShow: 3, 
  arrows: false,
  variableWidth: true,
  asNavFor: '.gooodPopup__slider',
  focusOnSelect: true
});

And fancybox:
$('.fancybox__goods').fancybox({
  beforeShow: function() {
    $('.gooodPopup__slider').slick('setPosition');
    $('.gooodPopup__dots').slick('setPosition');
  },
});

Thank you in advance for your help!

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question