How to close gallery lightbox/shadowbox when user presses back button
-
I have a semi-custom implementation of Nggallery and a shadowbox skin working just great, but I am wondering if there is any way I can get the gallery to close when a user hits the back button, instead of going to the previous page.
For example, If a user browses to https://new.3blindmiceusa.com/products/window-blinds/
and then clicks on https://new.3blindmiceusa.com/products/window-blinds/wood/I have a gallery loading and all the navigation elements work fine. The arrow buttons work, the “x” works, hitting “esc” works, but if a user hits the “back” button on their mouse or the browser, thinking they will go to the previous image they were viewing, it will actually take them back to https://new.3blindmiceusa.com/products/window-blinds because none of the image URLs are being loaded.
I have searched all over, and the closest thing I can find would be to disable the back button, but that would actually prevent the user from going back when they wanted to. Maybe I could write a script that only disables the back button while the shadwobox isOpen, but that seems a little over done.
Any suggestions or ideas?
- The topic ‘How to close gallery lightbox/shadowbox when user presses back button’ is closed to new replies.