Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I make the modal popup scroll its contents with the page?

I've got a modal popup and when it loads contents that are taller than the browser height I am unable to scroll down to view the rest of the information. Instead the background can scroll but the popup won't.

Instead I'd like to have the popup stay put and when the user scrolls up or down it leave the popup in place and let them scroll to the bottom of the contents. If you make a super long post on Facebook the popup works correctly and I'd like to know how I can get this same effect with this control.

like image 546
Middletone Avatar asked Dec 12 '09 18:12

Middletone


1 Answers

In the css of your modal popup, set the width of the modalpop up, then set the overflow:auto. That will give you horizontal scrollbar. Example:

.ModalPopupPanel
{
  width:900px;
  overflow:auto;
}

So,when the content width exceed the 900px, the horizontal scrollbar will show up. The same is true for the vertical scrollbar where you need to set the height of the modalpop.

like image 178
Public Helper Avatar answered Oct 13 '22 01:10

Public Helper