Search code examples
javascriptjquerycarousel

Slick carousel right to left


I've setup slick carousel to continuously scroll, however I need to to scroll in the oposite direction. Adding the RTL option didn't seem to work.

Fiddle here (currently left to right)

http://jsfiddle.net/mth2ghod/

 $(function(){
    $('.slider').slick({

        speed: 10000,
        autoplay: true,
        autoplaySpeed: 100,
        cssEase: 'linear',
        slidesToShow: 1,
        slidesToScroll: 1,
        variableWidth: true

    });
});

Solution

  • Change the slidesToScroll to a -1 (it will change the slide direction)

     $(function(){
        $('.slider').slick({
           speed: 10000,
           autoplay: true,
           autoplaySpeed: 100,
           cssEase: 'linear',
           slidesToShow: 1,
           slidesToScroll: -1,
           variableWidth: true
    
        });
    });