Why JQuery dialog goes slightly outside the main window when in maximized mode
When i open Jquery dialog in maximized mode using $(window).width() & $(window).height() or $(document).width() & $(document).height(). It slightly goes out of main window. My Jquery code is:
function DisableBackGrd() {
var dlg = $("#divCreateInqGeneral").dialog({ bgiframe: true,
width: $(window).width(),
height: $(window).height(),
modal: true,
resizable: false,
focus: function () { hideScrollBars(); },
open: function () { hideScrollBars(); },
beforeClose: function () { showScrollBars(); }
});
dlg.parent().appendTo(jQuery("form:first"));
}
Relevant HTML
<div id="divCreateInqGeneral" styl开发者_如何学JAVAe="display: none">
<uc1:CreateInqGeneral ID="Tab1UCCreateInqGeneral" runat="server" />
</div>
I found something here:
var theDialog = $(".mydialog").dialog({
autoOpen: false,
resizable: false,
modal: true,
width:'auto'
});
Bind an event in window.resize like this:
$(window).resize(){
//Resize height/width of your dialog here
}
精彩评论