bengem bengem - 4 months ago 36
Javascript Question

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

});
});

Answer

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

    });
});