Tuesday, June 4, 2024
 Popular · Latest · Hot · Upcoming
78
rated 0 times [  85] [ 7]  / answers: 1 / hits: 20651  / 10 Years ago, sun, march 9, 2014, 12:00:00

I have a webpage with a lightbox in it, inside the lightbox there is a scrollbar.
I want to disable the main window scrollbar and keep the lightbox scrollbar enabled.



Not just to hide the scrollbar but to disable scrolling of the window at all (beside scrolling the lightbox).



How can I do it?


More From » jquery

 Answers
27

You probably need to call



$(body).scroll(function(e){ e.preventDefault()});


when lightbox is opened.



You also may be interested with this question.


[#72083] Friday, March 7, 2014, 10 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
quinn

Total Points: 160
Total Questions: 86
Total Answers: 101

Location: Belarus
Member since Tue, Mar 14, 2023
1 Year ago
;