If you're referring to space taken up by rendered but hidden Dialogs, then you can set their position to [0, 0] (or offscreen top/left if your Dialogs are larger than the static content on the page) as opposed to leaving them in their default DOM positions.
If you're referring to space taken up by the markup for a Dialog before it has been initialized/rendered, then the approach you mention, using display, is fine. You do lose out on the progressive enhancement value, unless you introduce this using JS, using say a class applied to body - but you need to make sure you set the display back to block BEFORE the Dialog is initialized
Here's an example which covers both the above:
p.s. If you are resetting the display BEFORE you initialize the dialog and if you have a page where you're seeing the "all grey screen" I can take a look at it.
Sent: Monday, May 12, 2008 5:57 AM
When I have multiple dialogs on a single page, it gets very long. This fouls the look, and is outright incompatible with the "Loading..." panel example - the panel appears in the middle of the very long HTML, instead of in the center of the screen.
How do I circumvent this? At the beginning I had all dialogs set to style="display: none", and set the style to display: block right before I created them. This also meant that I didn't create a dialog until the first time it was to be shown. It also had the problem of occasionally leaving me with an all grey screen, the mask wasn't removed after a dialog was closed.
So is the correct way to do this to set style="display: none", but to create all dialogs at the start of the script, and set style="display: block" after each dialog has been created?