# Add pinch zoom for mobile devices

**URL:** <https://community.elfsight.com/t/add-pinch-zoom-for-mobile-devices/77867>\
**Category:** Photo Gallery\
**Tags:** Gathering-Feedback\
**Created:** [October 23, 2024, 3:17pm UTC](https://community.elfsight.com/t/add-pinch-zoom-for-mobile-devices/77867 "2024-10-23T15:17:25Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Danielle\_Adnitt](https://sea2.discourse-cdn.com/flex020/user_avatar/community.elfsight.com/danielle_adnitt/32/35439_2.png) [@Danielle\_Adnitt](https://community.elfsight.com/u/Danielle_Adnitt)\
**Post date:** [October 23, 2024, 3:17pm UTC](https://community.elfsight.com/t/add-pinch-zoom-for-mobile-devices/77867/1 "2024-10-23T15:17:25Z")

</div>

Our clients want to zoom into images they click on from our photo galleries but when they do they are unable to pinch zoom on mobile and only have the option of the plus and minus signs which are cumbersome. Is there a simple solution to make pinch zoom possible on images once they have been clicked on?

---

<div class="post-metadata">

**Author:** ![Max](https://sea2.discourse-cdn.com/flex020/user_avatar/community.elfsight.com/max/32/710_2.png) [@Max](https://community.elfsight.com/u/Max)\
**Post date:** [October 23, 2024, 4:23pm UTC](https://community.elfsight.com/t/add-pinch-zoom-for-mobile-devices/77867/2 "2024-10-23T16:23:13Z")

</div>

Hi there, @Danielle_Adnitt 👋

Great thought, thanks for sharing! If more users support this request, it might be considered in the future 🙂

---

<div class="post-metadata">

**Author:** ![Max](https://sea2.discourse-cdn.com/flex020/user_avatar/community.elfsight.com/max/32/710_2.png) [@Max](https://community.elfsight.com/u/Max)\
**Post date:** [January 22, 2026, 2:50pm UTC](https://community.elfsight.com/t/add-pinch-zoom-for-mobile-devices/77867/3 "2026-01-22T14:50:30Z")

</div>

While this feature isn’t released yet, our devs shared a custom solution. This script should be added to the **Custom JS** section on the **Style** tab of your widget’s settings 🙂

```auto
const preventSlideSwitchWhileZooming = (event) => {
  if (
    event.target?.closest('#fslightbox-container') &&
    event.touches.length > 1
  ) {
    event.stopImmediatePropagation();
  }
};

document.addEventListener('touchstart', preventSlideSwitchWhileZooming);
document.addEventListener('touchmove', preventSlideSwitchWhileZooming);
document.addEventListener('touchend', preventSlideSwitchWhileZooming);

```
