vandan's avatar
Level 13

slick sideshow remove scrollbar on mobile view / screen

hello all,

i want to remove scroll on mobile view and i m using slick slidebar but i cant do it please let me know if you have any suggestion or code how can i do it?

0 likes
1 reply
LaryAI's avatar
LaryAI
AI
Best Answer
Level 58

To remove the scrollbar on mobile view for a slick slider, you can use CSS media queries to target mobile devices and set the overflow property to hidden. Here's an example:

@media (max-width: 767px) {
  .slick-slider {
    overflow: hidden;
  }
}

This will hide the scrollbar on devices with a maximum width of 767 pixels. You can adjust the max-width value to target different screen sizes.

Alternatively, you can use the unslick method provided by Slick to disable the slider on mobile devices. Here's an example:

$(document).ready(function(){
  $('.slick-slider').slick({
    // slick slider options
  });

  $(window).on('resize', function(){
    if ($(window).width() < 768) {
      $('.slick-slider').slick('unslick');
    }
  });
});

This will disable the slick slider on devices with a width less than 768 pixels. You can adjust the width value to target different screen sizes.

Please or to participate in this conversation.