wordpressdev_meg
wordpressdev_meg

Reputation: 143

Slick Slider - slide from left to right

Just wondering if anyone can help please.

I'm using Slick Slider on one my WordPress sites, and the slider is currently sliding from right to left. I'd like the slider to slide from left to right when it changes slides.

Does anyone have any suggestions please?

<script type="text/javascript">
$(document).ready(function(){
$('.fadex').slick({
    dots: false,
    speed: 500,
    autoplay: true,
    autoplaySpeed: 3500,
    infinite: true,
    centerMode: false, 
    initialSlide: 0,
    arrows: true,
});
});
</script>

Upvotes: 0

Views: 6823

Answers (2)

Vinh Nguyen
Vinh Nguyen

Reputation: 1

rtl : [slick-slider rtl=”true”] (for rtl mode. By default value is “false”. Options are “true OR false”).

Simply use the options provided. By default value is “false”, change this to true, or vice versa to change the direction.

<script type="text/javascript">
$(document).ready(function(){
$('.fadex').slick({
    dots: false,
    speed: 500,
    autoplay: true,
    autoplaySpeed: 3500,
    infinite: true,
    centerMode: false, 
    initialSlide: 0,
    arrows: true,
    rtl: true,

});
});
</script>

Upvotes: 0

Makarious saad
Makarious saad

Reputation: 21

To solve this problem requires you to change the style of the left value

Because it adds a negative to the single-product-image class

Inside the slick.js file at line 866

Add a new line and add this condition

if($("html").attr("dir") == 'rtl'){ var newE = t.slideWidth * o; }else{ var newE = t.slideWidth * o * -1; }

And change this condition

(e = t.slideWidth * o * -1)

to this

(e = newE)

Then the page orientation will be relied upon in the case of RTL or LTR.

Upvotes: 0

Related Questions