• Resolved pangaeawebservices

    (@pangaeawebservices)


    I would like to close a lightbox on mobile by pushing the back button.

    Right now the back button takes the user to the previous page and not to the current gallery.

    Is there a solution using JQuery?

    The page I need help with: [log in to see the link]

Viewing 1 replies (of 1 total)
  • Plugin Author bradvin

    (@bradvin)

    hi @pangaeawebservices

    The back button should only take you back when the browser history changes. By opening the lightbox, the history is not updated within FooBox, but it can be added with some custom JS.

    If you have FooBox PRO, you can add some code from the FooBox Settings -> Custom JS & CSS tabs.

    If you are using FREE, then you can add this custom JS to your page to add to the browser history when the lightbox opens:

    
    $('.fbx-instance').on('foobox.afterLoad', function(e) {
      history.pushState( { image: e.fb.item.url }, "image opened in lightbox", e.fb.item.url);
    });
    
Viewing 1 replies (of 1 total)
  • The topic ‘Close Light Box with Back Button on Mobile’ is closed to new replies.