title: JQuery Modal Dialog does not behave as in example
body: <p>First of all, I am new to JQuery and Web technologies overall. I have been playing with node.js/expressjs/jade.js and JQuery few weeks so far.</p>
  
  <p>For some reason I just cant get modal dialog work. Following code shows button and button click shows "dialog". This dialog is just div element below button, not over button. On the top of that you cannot move button and style is not same as shown in JQuery example. </p>
  
  <p><a href="http://jqueryui.com/demos/dialog/" rel="nofollow">http://jqueryui.com/demos/dialog/</a></p>
  
  <p>Could someone be kind and point the problem or copy-paste working example. Thanks.</p>
  
  <pre><code>&lt;html&gt;
    &lt;head&gt;
      &lt;title&gt;Places Server&lt;/title&gt;
      &lt;link rel="stylesheet" href="http://code.jquery.com/ui/1.8.21/themes/base/jquery-ui.css" type="text/css" media="all"/&gt;
      &lt;link rel="stylesheet" href="http://static.jquery.com/ui/css/demo-docs-theme/ui.theme.css" type="text/css" media="all"/&gt;
      &lt;script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"&gt;&lt;/script&gt;
      &lt;script&gt;
        jQuery(document).ready( function(){
              jQuery("#myButton").click( showDialog );
                  //variable to reference window
                  $myWindow = jQuery('#myDiv');
  
                  //instantiate the dialog
                  $myWindow.dialog({ height: 350,
                          width: 400,
                          modal: true,
                          position: 'center',
                          autoOpen:false,
                          title:'Hello World'
                          //overlay: { opacity: 0.5, background: 'black'}
                          });
                  }
  
        );
        //function to show dialog   
        var showDialog = function() {
          //if the contents have been hidden with css, you need this
          $myWindow.show(); 
          //open the dialog
          $myWindow.dialog("open");
          }
  
        //function to close dialog, probably called by a button in the dialog
        var closeDialog = function() {
          $myWindow.dialog("close");
        }
      &lt;/script&gt;
    &lt;/head&gt;
    &lt;body&gt;     
      &lt;input id="myButton" name="myButton" value="Click Me" type="button"/&gt;
      &lt;div id="myDiv" style="display:none" class="ui-dialog ui-widget ui-widget-content ui-corner-all undefined ui-draggable ui-resizable"&gt;
        &lt;div class="ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix"&gt;&lt;span id="ui-dialog-title-dialog" class="ui-dialog-title"&gt;Dialog title&lt;/span&gt;&lt;/div&gt;
        &lt;div id="dialog" class="ui-dialog-content ui-widget-content"&gt;
          &lt;p&gt;I am a modal dialog&lt;/p&gt;
        &lt;/div&gt;
      &lt;/div&gt;
    &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>