banthagroup / fslightbox

An easy to use vanilla JavaScript plug-in without production dependencies for displaying images, videos, or, through custom sources, anything you want in a clean overlying box.
MIT License
351 stars 30 forks source link

Configuration available for back button to close the lightbox? #154

Open garretwilson opened 3 years ago

garretwilson commented 3 years ago

Do you have a configuration setting that will make the browser back button (and the Android back button) merely close the lightbox and not leave the page?

After much study and comparison (see #141), I went with another competing library for my image gallery lightbox. However after deployment I discovered that the other library does not provide any way for the "back" button merely to close the lightbox. Instead, the back button will go to the previous page. This is quite jarring to a user, especially on a mobile device. It is natural to click/tap "back" to close a gallery view, but in the case of the competing library, the gallery closes but the browser navigates backwards in history, even kicking the user off my site altogether! This is close to a deal breaker, so I'm considering using fslightbox after all.

Can I configure fslightbox so that the "back" button merely closes the lightbox, but leaves the user on the same page?

I would happily pay for this feature. I had already offered in #141 to purchase a license to help fund further development. I was disappointed when no one would clarify the license terms in response to my query in #143.

I would love to give you money if this feature is available.

garretwilson commented 3 years ago

@piotrzdziarski , are you around? How much would it cost to get this improvement?