Open ali-hellani opened 6 years ago
Yes.
Any release planned?
Any news about this guys? If not, can you recommend a library that supports rtl?
Supper busy recently. Won't be able to add this feature in 1 month.
Any news about this feature?
Just finished center
, will start work on this.
But it will take some time due to the overall complexity.
+1 for rtl support
Any news about this feature?
Any news about this feature, any idea when it will added?
RTL support would be amazing. Any updates @ganlanyuan ? Thanks!!!
It probably needs some more testing but looks like my quick fix added RTL support for horizontal carousel slider setup, just check: https://github.com/piotrku/tiny-slider/commit/a7b88d66e3513ebcd01df4bd062791271b1b3d24
Any updates?
Hi, any updates on this please? RTL support would be perfect, thanks
Any updates?
Until a PR is approved or is developed. A quick fix is to make a wrapper to the dom object defined in your container
, and make that wrapper have direction: ltr
style. It doesn't look so bad on Arabic websites and it's a good solution if you want to continue using this lib.
@ganlanyuan Hi, I'm not so advanced dev. I would like to try adding RTL support, if you don't mind and if no one is already doing it?
I'm setting up its dev env as documented in Contribute file. Please, let me if there any other important point I should be aware of or any advice.
I'm going to use this convention: dir="rtl"
in HTML as switch, same CSS files for both LTR/RTL.
As documented in Drupal docs - CSS formatting guidelines.
Any news about this ? @ganlanyuan
@ganlanyuan Hi, any plan for adding RTL support?
It probably needs some more testing but looks like my quick fix added RTL support for horizontal carousel slider setup, just check: piotrku@a7b88d6
@piotrku Thanks for this! In my test this worked like a charm.
Would be nice to be implemented in the original repo :)
using
.tns-carousel {
display: flex;
flex-direction: row-reverse;
}
reverses the items but still it starts from left
rtl repo: npm i tiny-slider-rtl --save
is there an update? adding RTL support similar to owl slider: https://owlcarousel2.github.io/OwlCarousel2/demos/rtl.html
Thanks! Dan
@danstramer check PR from jmfarina https://github.com/ganlanyuan/tiny-slider/pull/658
Until a PR is approved or is developed. A quick fix is to make a wrapper to the dom object defined in your
container
, and make that wrapper havedirection: ltr
style. It doesn't look so bad on Arabic websites and it's a good solution if you want to continue using this lib.
many thanks
from tiny-slider.js inside this if (hasAutoplay) {} change
var autoplayDirection = options.autoplayDirection === 'forward' ? 1 : -1,
to var autoplayDirection = options.autoplayDirection === 'backward' ? 1 : -1,
to change direction i used this and worked
.tns-carousel { display: flex; flex-direction: row-reverse; }
It also makes problem if Lazy load be on
As tiny-slider seems dead totally, I switched to the Splide. It supports RTL very well
This
is how I handled RTL; it works perfectly. I played with the direction: rtl/ltr, reversed the slider row, created a function that moves the slider to the end, and then displays the hidden slider. !! The code is not complete; I only extracted what I changed.
html:dir(rtl) {
.tns-item {
direction: rtl;
}
.slider-wrapper {
direction: ltr;
}
.slider {
flex-direction: row-reverse;
}
.hidden-carousel {
visibility: hidden;
}
}
<div class="hidden-carousel">
{{#with shop.carousel}}
<div>
<div class="c-carousel">
<div class="slider-wrapper">
<div id="slider" class="slider">
{{#each list }}
<div class="h-pt-8">card-data</div>
{{/each}}
</div>
</div>
</div>
</div>
{{/with}}
</div>
<script>
document.addEventListener("DOMContentLoaded", function() {
document
.querySelectorAll("[data-carousel-id]")
.forEach(function(carouselElement) {
var isRTL = document.documentElement.getAttribute("dir") === "rtl";
!isRTL && carouselElement.classList.remove("hidden-carousel");
function goToLastSlide() {
var interval = setInterval(function() {
var info = slider.getInfo();
if (info.index + info.items < info.slideCount) {
nextArrow.click();
} else {
clearInterval(interval);
setTimeout(function() {
carouselElement.classList.remove("hidden-carousel");
}, 200);
}
}, 0);
}
isRTL && goToLastSlide();
});
});
</script>
will the plugin have RTL support in the future ?!