Skip to content

Commit d0ebee9

Browse files
authored
simple support for rtl (#254)
adding support by detecting the dir attribute on the html tag, which is usually set on RTL websites.
1 parent f362b34 commit d0ebee9

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/baguetteBox.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -686,7 +686,7 @@
686686
}
687687

688688
function updateOffset() {
689-
var offset = -currentIndex * 100 + '%';
689+
var offset = -currentIndex * ( document.getElementsByTagName('html')[0].getAttribute('dir') == 'rtl' ? -100 : 100 ) + '%';
690690
if (options.animation === 'fadeIn') {
691691
slider.style.opacity = 0;
692692
setTimeout(function() {

0 commit comments

Comments
 (0)