jsor / lity

Lightweight, accessible and responsive lightbox.
https://sorgalla.com/lity/
MIT License
1.16k stars 195 forks source link

pinch to zoom #24

Open axeff opened 8 years ago

axeff commented 8 years ago

Viewing an image where you need to use pinch to zoom gesture for more detailed view seems impossible.

img_0017 img_0018

jsor commented 8 years ago

Yep, this isn't ideal atm. sorry. It's on my todo-list...

jsor commented 8 years ago

There are two workarounds to support better zooming of images:

  1. Make the underlying content non-scrollable:

    .lity-active,
    .lity-active body {
       overflow: hidden;
    }
  2. Use a plugin to allow zooming of the image, eg. jquery.panzoom

    $(document).on('lity:ready', function(e, lightbox) {
       lightbox.find('img').panzoom();
    });
RavanH commented 6 years ago
.lity-active,
.lity-active body {
    overflow: hidden;
}

Why is this not part of the default CSS ? It seems useful to remove scroll bars to allow more space for large (wide) images and to prevent scrolling issues with inline and iframe content on iOS mobile devices.

jsor commented 6 years ago

I might consider this for the next version. 👍

RavanH commented 6 years ago

It disables background scrolling too, which seems to bother some people...