Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Any way to stop the page BEHIND jquery tools overlay from scrolling?

I'm using jquery tools overlay and it's great. However, the scrolling behavior is a little strange. If you open an overlay and put your mouse over it, you can still scroll the page behind it if you're at the top/bottom of the overlay.

Is there a way (preferably a jquery tools built in way) to prevent the page BEHIND the overlay from scrolling?

like image 803
Dty Avatar asked Dec 10 '25 09:12

Dty


1 Answers

Not used jquery tools but when showing a ui dialog it is common to do the following to prevent the screen scrolling.

$("body").css("overflow", "hidden");

You could also add an event to the window scroll to prevent scrolling as this SO answer describes and also this article

like image 96
redsquare Avatar answered Dec 11 '25 23:12

redsquare