dcsimg
www.webdeveloper.com
Results 1 to 2 of 2

Thread: jQuery Dialog changes heigth

  1. #1
    Join Date
    Dec 2005
    Posts
    268

    jQuery Dialog changes heigth

    Hi,

    I wish to use a jQueryUI dialog without a title bar, so I hid it when it was opened. See here for an example. You will notice that #dialog is 159.033px high. Then close the dialog, and open it again, and it is now 40px higher (i.e. 200.033px high).

    Does anyone know why the height changes, and how to prevent it to change? Thank you


    HTML Code:
    <!DOCTYPE HTML>
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <title>Dialogs</title>
    <!-- <style type="text/css">.hide-title-bar .ui-dialog-titlebar { display: none; }</style> -->
    <link type="text/css" href="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/themes/smoothness/jquery-ui.css" rel="stylesheet" />
    <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js" language="javascript"></script>
    <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/jquery-ui.min.js" language="javascript"></script>
    <script type="text/javascript">
    $(document).ready(function(){
        $(".openDialog").click(function(){$("#dialog").dialog("open");});
        
        $("#dialog").dialog({
            autoOpen: false,
            resizable   : false,
            height  : 300,
            width   : 440, 
            modal   : true,
            dialogClass : 'hide-title-bar',
            open: function() {$(this).dialog("widget").find(".ui-dialog-titlebar").hide();},
            buttons : [{text:'CANCEL',click: function() {$(this).dialog("close");}}]
        });
    
    });
    </script>
    </head>
    <body>
    <input type="button" value="ClickMe" class="openDialog" />
    <div id="dialog"></div>
    </body>
    </html>

  2. #2
    Join Date
    Dec 2005
    Posts
    268
    Hello again, Any suggestions? I've spent hours trying to figure this out, and am at a total loss. Thanks

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles