Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

can't support rtl language ! #192

Open
ho3ein-y opened this issue Jun 26, 2018 · 2 comments
Open

can't support rtl language ! #192

ho3ein-y opened this issue Jun 26, 2018 · 2 comments

Comments

@ho3ein-y
Copy link

please update code for RTL language's.
thanks

@ho3ein-y
Copy link
Author

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

@ho3ein-y ho3ein-y reopened this Jun 27, 2018
@ghost
Copy link

ghost commented Oct 19, 2020

On version 1.11.1 I solved it by adding a little minus:
Before: var e = 100 * -u + '%';
After: var e = -100 * -u + '%';

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant