baguetteBox.js
baguetteBox.js copied to clipboard
can't support rtl language !
please update code for RTL language's. thanks
i'm ready for RTL language modify the baguetteBox.js: add RTL proprty to option 👍 // Global options and their defaults
var options = {},
defaults = {
RTL:false,
captions: true,
buttons: 'auto',
fullScreen: false,
noScrollbars: false,
bodyClass: 'baguetteBox-open',
titleTag: false,
async: false,
preload: 2,
animation: 'slideIn',
afterShow: null,
afterHide: null,
onChange: null,
overlayBackgroundColor: 'rgba(0,0,0,.8)'
};
and change line in updateOffset() function 💯
from :
offset = -currentIndex * 100 + '%';
to :
var offset;
if (options.RTL)
offset = currentIndex * 100 + '%';
else
offset = -currentIndex * 100 + '%';
/*initial gallery with RTL option*/
baguetteBox.run('.galleryBox', {RTL:true});
and enjoy 🥇
PERSIAN GULF
On version 1.11.1 I solved it by adding a little minus: Before: var e = 100 * -u + '%'; After: var e = -100 * -u + '%';