1

As the title says, I have this problem. The option to disable scrolling simply applies

html.lb-disable-scrolling{overflow:hidden;position:fixed;height:100vh;width:100vw;}

To the html. Upon changing to set it to body instead of html and removing position it works as intended. (had to change target in js also from html to body)

body.lb-disable-scrolling{overflow:hidden;height:100vh;width:100vw}

But I wonder if there is a better solution?

EDIT: It seems that his solution also does not work on phone device.

KitreC
  • 23
  • 5

2 Answers2

1

Just Add below line to your lightbox-plus-jquery.min.js file.

lightbox.option({ disableScrolling: true });

go to example, open the console, and enter the above line.

After Enter Close Model and Open Image Again.It Will definitely works.

Ashok K
  • 46
  • 4
0

This behavior was a bug in the Lightbox2 script. You can see a report of it here in the official repo: https://github.com/lokesh/lightbox2/issues/620

It was fixed in v2.11.0 that was released April 21, 2019. Upgrading should resolve your issue. https://github.com/lokesh/lightbox2/releases/tag/v2.11.0

Lokesh Dhakar
  • 5,289
  • 5
  • 22
  • 24