0
votes

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>
2
it is related to this stackoverflow.com/questions/54557395/…?Vel
That's all working fine. I think its just a general slider thing, most don't seem to slide that way so I've left the problem for now. Thanks for all your help.wordpressdev_meg

2 Answers

0
votes

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.

0
votes

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>