bytecode77
bytecode77

Reputation: 14840

div overflow scroll: when scrolled to bottom, content starts scrolling

I have a modal dialog with a scrollable div inside. The div is set to

overflow: scroll;

However, when the user scrolls all the way down inside the div, the content behind the popup starts scrolling down.

Question: When the popup is open, I don't want the user to be able to scroll the main page behind it. Is this possible?

I don't think there is need for me to provide code, as this is a very general question.

Upvotes: 0

Views: 347

Answers (2)

KAS
KAS

Reputation: 820

Try setting the property for the body overflow: hidden when pop up opens and overflow: hidden when popup closes.

Upvotes: 2

Ashwani
Ashwani

Reputation: 3481

Using JQuery set css as

overflow: hidden 

when popup is open

and on popup close use

overflow : auto or overflow : scroll as you wish.

I think, I don't need to write code for it.

Upvotes: 1

Related Questions