title: jQuery ui fullscreen dialog
body: <p>I 'm trying to make a fullscreen dialog using jquery ui.</p>
  
  <p>I have some content loaded via ajax, and the result fills the dialog:</p>
  
  <pre><code>function openResource(id) {
    $.ajax({
      url      : "",
      type     : 'post',
      dataType : 'html',
      data : {
        idRes: id
      },
      success : function(response) {
        $("#popupRecurso")
          .html("&lt;div style='float:right; cursor: pointer;' onclick='$(\"#popupRecurso\").dialog(\"destroy\");'&gt;fechar&lt;/div&gt;" + response);
  
        $("#popupRecurso").dialog({
          title       : '',
          bgiframe    : true,
          position    : 'center',
          draggable   : false,
          resizable   : false,
          dialogClass : 'dialogRecurso',
          width       : $(window).width(),
          height      : $(window).height(),
          stack       : true,
          zIndex      : 99999,
          autoOpen    : true,
          modal       : true,
          open        : function() {
            $(".ui-dialog-titlebar").hide();
          },
          error : function(err) {
            alert(err);   
          }
        });
      }
    });
  }
  </code></pre>
  
  <p>Unfortunately, the dialog does not appear on center and without the correct dimensions.
  Has anyone has ever had the same problem ?</p>
  
  <p>Thanks</p>