Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable zoom scrolling option in lightbox #412

Open
Usamaashraff opened this issue Mar 15, 2024 · 1 comment
Open

Disable zoom scrolling option in lightbox #412

Usamaashraff opened this issue Mar 15, 2024 · 1 comment

Comments

@Usamaashraff
Copy link

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
Copy link

genescu commented Jul 15, 2024

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);
        }
      }
    }
  });

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants