biati-digital / glightbox

Pure Javascript lightbox with mobile support. It can handle images, videos with autoplay, inline content and iframes
MIT License
2.01k stars 226 forks source link

feat: Support for ordering images right to left #460

Open DenverCoder1 opened 8 months ago

DenverCoder1 commented 8 months ago

Resolves #459

This adds support for the direction option in Glightbox which allows the images to flow from right to left instead of left to right to make it more natural for rtl language interfaces (such as Arabic and Hebrew).

const lightbox = GLightbox({ direction: 'rtl' });

When the direction is set to rtl, pressing the left arrow key, left lightbox button, or swiping right will advance to the next image and pressing the right arrow key, right lightbox button, or swiping left will go to the previous image. The slide and slideBack CSS effects are also reversed.