Enes
Enes

Reputation: 112

Scroll hide problem in Lightbox2 (by Lokesh Dhakar)

I don't want the scroll to be opened when clicking the image for Lightbox

Error link : https://cdn.pbrd.co/images/HSzC8Ly.jpg

Source Code download link : https://lokeshdhakar.com/projects/lightbox2/

Upvotes: 0

Views: 499

Answers (2)

Enes
Enes

Reputation: 112

Problem solved.

The height is taking a very high value. This height comes from the lightbox.js file. The overflow problem is troubleshooted when you do height:100% in the css class

Add the following line to the .lightboxOverlay class in css.`

.lightboxOverlay {height:100% !important; /* for Lightbox Scroll hide */}

Upvotes: 1

SurfMan
SurfMan

Reputation: 1813

You need to add the option disableScrolling to prevent the page from scrolling while Lightbox is open:

lightbox.option({
  'disableScrolling': true
})

Upvotes: 0

Related Questions