$(document).ready(function () { if ($(".autoplay").hasClass("with_arrows")) { $('.autoplay').slick({ dots: false, arrows: true, infinite: true, speed: 600, slidesToShow: 3, slidesToScroll: 1, autoplay: true, autoplaySpeed: 2500, vertical: true, verticalSwiping: true }); } else if ($(".autoplay").hasClass("partner_with_arrows")) { $('.autoplay').slick({ dots: false, arrows: true, infinite: true, speed: 600, slidesToShow: 4, slidesToScroll: 1, autoplay: true, autoplaySpeed: 2500, vertical: true, verticalSwiping: true }); } else { $('.autoplay').slick({ dots: false, arrows: false, infinite: true, speed: 600, slidesToShow: 3, slidesToScroll: 1, autoplay: true, autoplaySpeed: 2500, vertical: true, verticalSwiping: true }); } });