1. User clicks on one of the images in gallery.
  2. Larger version appears in lightbox.
  3. When user scrolls down, should the lightbox close or not?

Live examples;

  • On Medium website lightbox can be closed when user scrolls down, you can test it here.
  • Lightbox on Quora or Google Photos does not have such behaviour.
  • Some lightbox scripts, for example PhotoSwipe, close on scroll.

What do you think? Is it worth implementing or it'll just confuse non tech savvy users?

  • What if the lightbox image is larger than the screen, either naturally or because the user has zoomed into it to view the details?
    – Nate Green
    Commented Aug 2, 2016 at 17:38

2 Answers 2


If it's one page design - the reason why it would make sense is because the primary navigation user action is scrolling, not clicking.

  • a lightbox would cover the navigation anyways, so this is not a good reason to do it
    – Devin
    Commented Aug 2, 2016 at 17:08

While there might be some user cases where carefully crafted experiences might allow this behavior, speaking of general available scripts, I wouldn't recommend it.

As an user, I want to know the available controls serve to a purpose (see locus of control) and you as a developer won't allow for random unexpected behaviors.

I'll give you an example: I click on some expandable element, and then scroll down to see the underlying content in context . If you close the lightbox, I'll be really annoyed. Simply put, you'd be willfully providing a bad experience that invalidates my intentionality. And even worse, you'd be doing it on purpose!

As for your examples:

On Medium website lightbox can be closed when user scrolls down, you can test it here.

This is not a lightbox by any means, they're telling a story and allow a behavior of enlarging a photo. They have no controls whatsoever, so by continuing the story, you get to the original version

Some lightbox scripts, for example PhotoSwipe, close on scroll.

Tested it on FF, couldn't see this behavior. However, barring testing and some nice UX study, you could do this as long as is pictures only content

In short: never negate control to users, never do anything random or unexpected, always strive for simple experiences most users know

Additional Reading:

  • 1
    Thank you. I do not entirely understand your statement about image viewer on Medium - "This is not a lightbox by any means". Why do you think that it's not a lightbox? Lightbox usually has just close icon, but it's skipped quite often.
    – Marvin3
    Commented Aug 2, 2016 at 17:43
  • A lightbox is a term that comes from photography, and it's basically a box (container) with lights with no surroundings. In UI terms, this is achieved by dimming the background with a transparency and focusing on the important element. It also has controls, sometimes really complex ones, going from closing buttons, captions, navigation, and so on. In Medium's case, not a single one of these elements are present. So something that doesn't share a single characteristic with a given element can't be that element, by definition
    – Devin
    Commented Aug 2, 2016 at 17:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.