Your Cart

Folio: lightbox instead of fullscreen does not work on touch

These forums are now closed to new replies / tickets.

Please open a support ticket from our new Support page.

Front Page Forums Questions Folio: lightbox instead of fullscreen does not work on touch

  • gravatar
    Adrian B
    March 6, 2015 at 9:13 am

    As others have asked before I wanted to use a lightbox in the
    Folio theme instead of fullscreen, especially since the fullscreen
    mode scrolls flashed the top of the page before displaying the
    fullscreen image when it scrolls to top (which I don’t understand
    why). On touch devices it does not scroll back to the gallery
    either.

    So I tried this code that David posted
    here
    and it worked on desktop.

    Galleria.ready(function() {
        var gallery = this;
        this.bind("thumbnail", function(e) {
            $(e.thumbTarget).parent().mousedown(function() {
                $(this).unbind("click");
                gallery.openLightbox(e.index);
            });
        });
    });
    

    I got rid of the annoying scroll-to-top of the background page.
    But when I use a touch device the the new lightbox is display on
    top of a fullscreen image. When I close the lightbox the fullscreen
    image is there and when I close it I’m att the top of the page
    (double bad).

    I guess the code above from David is for desktop only, how can I
    extend it to touch as well, so I can get rid of the scroll-to-top
    behavior?


    gravatar
    Agichama AB
    March 6, 2015 at 12:55 pm

    This is Adrian again, now logged in with the account that bought
    Folio. Should I start a new thread to make it VIP?


    gravatar
    Agichama AB
    March 6, 2015 at 1:24 pm

    When I think about this I actually rather NOT have the lightbox
    on touch, only fullscreen. The fullscreen makes more sense on
    mobile, I just wish it didn’t scroll to top.

    So my question would rather be:

    How do I modify the code above to make it only on desktop?

    And then:

    Is there any way to make the page NOT scroll to top when using
    fullscreen?


    gravatar
    Agichama AB
    March 6, 2015 at 2:52 pm

    Oh, the first part was easy:

    Galleria.ready(function() {
        if( !Galleria.TOUCH ) {
            var gallery = this;
            this.bind("thumbnail", function(e) {
                $(e.thumbTarget).parent().mousedown(function() {
                    $(this).unbind("click");
                    gallery.openLightbox(e.index);
                });
            });
        }
    });
    


Galleria.io uses cookies to store information. You can read more about that in our Privacy Policy. I understand