代码之家  ›  专栏  ›  技术社区  ›  Dan Williams

jquery对话框高度有问题

  •  3
  • Dan Williams  · 技术社区  · 14 年前

    我似乎无法让对话框打开到我想要的高度,我可以看到标题栏,但只有用鼠标展开对话框后才能获取内容。

    我的密码 http://jsfiddle.net/Uu2G4/3/

    <div id="ImageDialog" style="display:none;height:500px;" class="ImageDialog ui-dialog">
        <div style="height:500px;">
            This is making me crazy!!!!
            <img class="productImage" src="http://static.jquery.com/files/rocker/images/logo_jquery_215x53.gif" />
        </div>
    </div>
    
    $(document).ready(function () {
        // init the image popup dialog
        $("#ImageDialog").dialog({ autoOpen: false, height: 500 });
    
        $(".open").click(function()
                     {
                         $("#ImageDialog").dialog("open");
                     });
    
        $(".close").click(function()
                     {
                         $("#ImageDialog").dialog("close");
                     });
    });
    
    1 回复  |  直到 14 年前
        1
  •  3
  •   Dan Williams    14 年前

    我在HTML中设置了DIV到UI对话框的类

    删除此项解决了问题。

    <div id="ImageDialog" style="display:none;height:500px;" class="ImageDialog">
        <div style="height:500px;">
            This is making me crazy!!!!
            <img class="productImage" src="http://static.jquery.com/files/rocker/images/logo_jquery_215x53.gif" />
        </div>
    </div>
    
    $(document).ready(function () {
        // init the image popup dialog
        $("#ImageDialog").dialog({ autoOpen: false, height: 500 });
    
        $(".open").click(function()
                     {
                         $("#ImageDialog").dialog("open");
                     });
    
        $(".close").click(function()
                     {
                         $("#ImageDialog").dialog("close");
                     });
    });