I am creating a dialog like in this page:
http://jqueryui.com/demos/dialog/#modal-confirmation
(click view source)
on the bottom is the div that gets placed in the dialog. The dialog works perfect when called by the javascript but the dialog is apparent at the bottom of the page when it loads. (minus all the styling that gets applied when it is called by the javascript function)
How can I hide the div and still allow the dialog to use it? I have tried setting style="visibility:hidden" but that prevents it from being shown when called by the javascript.
Hiding the dialog window is as simple as setting the Visible property to False.
Select the close button using the class “ui-dialog-titlebar-close” and hide it using the hide() method.
The jQuery UI dialog method is used to create a basic dialog window which is positioned into the viewport and protected from page content. It has a title bar and a content area, and can be moved, resized and closed with the 'x' icon by default.
This may be a stupid question, but instead of "visibility:hidden"
have you tried "display:none;"
? I had to solve the same problem for a project I'm working on and I'm reasonably sure display:none worked.
You can also use the
$(foo).dialog({ autoOpen: false });
option to "initialize" the dialog (thus hiding it and all that good stuff). The only catch is, you'll probably see the dialog "flicker" as the page loads but before jQuery has a chance to hide it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With