Saturday, March 24, 2012

Modal popup, calculated screen size and scrolling...

I have a modal popup that pops up over a web page that does not require scrolling to view the content. As soon as the modal popups up, scroll bars appear.

I looked at the source code for the modal, and it calculates the screen size to make the background fit correctly, but it some how figures in the size of the modal popup content into it's calculation. It then sets the background height and width according to that. The most annoying is if the modal is over 550px wide, it will put scroll bars on the bottom. If you scroll those, the page css doesn't cover the extra space and looks horrible.

I have played with the modal and parent containers' css for size and position, but I can't get rid of the scroll bars. I even set the body's overflow to hidden which really f's up the look.

What can I do for this?

I figured it out. Set the panel to absolute and set the top to 0px. Doesn't change the position actually, but tricks the calculation of the screen size.

No comments:

Post a Comment