Reputation: 15197
I am jQuery to use a Div as a dialog, But before the dialog is called the Div shows at the bottom of my Screen.
How can i hide this div?
<div id = "PrintDialog" title="Warning">
<p>Once you print, no changes may be made to this contract. Are you sure you want to print?</p>
<input type="button" value="Print" id="btnDialogPrint" />
<input type="button" value="Cancel" id="btnDialogCancel" />
</div>
I want to still use the Div, just not have it displayed unless its the dialog.
Thanks in advance.
Upvotes: 0
Views: 248
Reputation: 1643
Just add class "hidden" to your and remove it when you want to show it as a dailog
<div id = "PrintDialog" title="Warning" class="hidden">
CSS for hidden: .hidden { display: none; }
Upvotes: 3
Reputation: 39
using css (if you want init dialog later):
<style type="text/css">
#PrintDialog{display:none;}
</style>
Using jQuery UI you just need to initialize dialog after page loaded:
<script type="text/javascript">
$(function(){
$("#PrintDialog").dialog({ <some arguments such as title and so on> });
});
</script>
Upvotes: 2
Reputation: 6732
Add style="display: none;"
to the div
like this:
<div id="PrintDialog" title="Warning" style="display: none;">
When the page loads, this prevents the div from being showed. jQuery will still show the dialog when you want it.
Upvotes: 5
Reputation: 1694
Use css : style="display:none"
<div id = "PrintDialog" title="Warning" style="display:none">
or use following jquery code
$('#PrintDialog').hide()
Upvotes: 3
Reputation: 4965
Try using the built in .hide() method.
i.e.
$('#PrintDialog').hide();
Upvotes: 0
Reputation: 13135
If you want to use jQuery you just add $("#PrintDialog").hide();
in your code.
Upvotes: 1
Reputation: 14088
Add style="display: none;" or add to your CSS class next code
#PrintDialog
{
display: none;
}
Upvotes: 2