Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

171
Views
Trouble Removing Slick Slider / Carosel Below Certain Resolution

I'm having trouble removing my slick carosel for screens below a certain resolution (768px). Here is the code I'm using (I found it here on Stack overflow). The trouble is, my slick carosel won't display at all after adding this code.

 $slickGreen = false;
    function greenSlider(){    
        if($(window).width() > 768){
            if(!$slickGreen){
                $('#book-carosel').slick({
            slidesToShow: 6,
        slidesToScroll: 1,
        autoplay: true,
        autoplaySpeed: 2000,
        arrows: true,
        infinite:true
       }).show();
   
                });
                $slickGreen = true;
            }
        } else if($(window).width() < 767){
            if($slickGreen){
                $('#book-carosel').slick('unslick');
                $slickGreen = false;
            }
        }
    };
 });

$(document).ready(function(){
        ....
        greenSlider();
    });
    $(window).on('resize', function(){
         ....
         greenSlider();
    });

My original code that does work to display the carosel is as follows:

  $(document).ready(function(){
      $('#book-carosel').slick({
        slidesToShow: 6,
        slidesToScroll: 1,
        autoplay: true,
        autoplaySpeed: 2000,
        arrows: true,
        infinite:true
   
      }).show();
    });

Any help would be much appreciated.

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!