2011-04-20 3 views
0

$ (window) .width() & $ (window) .height() 또는 $ (document) .width를 사용하여 최대화 모드에서 Jquery 대화 상자를 열면) & $ (문서) .height(). 메인 윈도우에서 약간 벗어납니다. 내 jQuery 코드는 다음과 같습니다최대화 모드 일 때 JQuery 대화 상자가 약간 밖에 나오는 이유

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")); 
    } 

관련 HTML

<div id="divCreateInqGeneral" style="display: none"> 
    <uc1:CreateInqGeneral ID="Tab1UCCreateInqGeneral" runat="server" /> 
</div> 
+0

너비와 높이를 100 %로하면 어떻게 될까? –

+0

어떻게? 너비 : '100 %', 높이 : '100 %'이 작동하지 않습니다. 예외를 throw합니다. – Tuscan

답변

1

});

1

바인딩이 같은 window.resize에서 이벤트 :

var theDialog = $(".mydialog").dialog({ 
    autoOpen: false, 
    resizable: false, 
    modal: true, 
    width:'auto' 

: 내가 여기서 뭔가를 발견

$(window).resize(){ 
//Resize height/width of your dialog here 
} 
관련 문제