title: How to resize jquery ui dialog with browser
body: <p>I open jquery ui dialog and load some content in it. But when I resize browser jq dialog doesn't change it's width/height. I have tried a few thing but no luck. Here how I open it:</p>
  
  <pre><code>$(document).ready(function () {
      var wWidth = $(window).width();
              var dWidth = wWidth * 0.9;
              var wHeight = $(window).height();
              var dHeight = wHeight * 0.9;
  
              $(".openDialog").live("click", function (e) {
                  e.preventDefault();
                  $("&lt;div&gt;&lt;/div&gt;")
                      .addClass("dialog")
                      .attr("id", $(this).attr("data-dialog-id"))
                      .appendTo("body")
                      .dialog({
                          title: $(this).attr("data-dialog-title"),
                          close: function () { $(this).remove() },
                          modal: true,
                          resizable: false,
                          show: 'fade',
                          width: dWidth,
                          height: dHeight,                    
                          create: function (event, ui) {
                              $(this).parents(".ui-dialog:first").find(".ui-dialog-titlebar").css("display", "none");
  
                              $(this).parents(".ui-dialog").css("padding", 0);
                              $(this).parents(".ui-dialog").css("border", 0);
                              $(this).parents(".ui-dialog:first").find(".ui-dialog-content").css("padding", 0);
  
                              $(this).parents(".ui-dialog:first").find(".ui-dialog-content").css("background", "#000000");
                              $(this).parents(".ui-dialog:first").find(".ui-dialog-content").css("overflow", "hidden");
  
                          }  
  
                      })
                      .load(this.href);
              });
  $(window).resize(function () {
              var wWidth = $(window).width();
              var dWidth = wWidth * 0.9;
              var wHeight = $(window).height();
              var dHeight = wHeight * 0.9;
              $(".openDialog").dialog("option", "width", dWidth);
              $(".openDialog").dialog("option", "height", dHeight);
          });
  });
  </code></pre>