nanostudio-org / nanogallery2

a modern photo / video gallery and lightbox [JS library]
https://nanogallery2.nanostudio.org
761 stars 112 forks source link

Disable zoom scrolling option in lightbox #412

Open Usamaashraff opened 7 months ago

Usamaashraff commented 7 months ago

Hello, I am looking for a way to disable the zoom scrolling effect while opening the Lightbox. I don't want the images to zoom in when viewed in a lightbox. However, I couldn't find any attribute related to this. Could you please help me out with this? Thank you.

genescu commented 3 months ago

You can set your own conf: conf{ imageZoom: false} then

around line: 10532

  if (G.O.imageZoom === undefined) {
    G.O.imageZoom = true;
  }

  jQuery(window).bind('mousewheel wheel', function (e) {

    if (G.O.imageZoom !== false) {

      if (G.VOM.viewerDisplayed && G.VOM.content.current.NGY2Item().mediaKind == 'img') {
        var deltaY = 0;
        e.preventDefault();

        if (ViewerZoomStart()) {
          if (e.originalEvent.deltaY) { // FireFox 17+ (IE9+, Chrome 31+?)
            deltaY = e.originalEvent.deltaY;
          } else if (e.originalEvent.wheelDelta) {
            deltaY = -e.originalEvent.wheelDelta;
          }
          ViewerZoomIn(deltaY <= 0 ? true : false);
        }
      }
    }
  });