转载
jquery ui 的弹出窗体 dialog 。有时会出现当再次 打开或在父窗体拖动时,高度会发生变化。则需要进行设置。open , dragstop 事件处理 $('#showResult').dialog({ height: 320, width: 300, position: ['right'], open: function (event, ui) { // Height setter has no effect after init either $(this).dialog("option", "height", 320); // Width setter works after initialization too $(this).dialog("option", "width", 300); }, dragStop: function (event, ui) { $(this).dialog("option", "height", 320); // Width setter works after initialization too $(this).dialog("option", "width", 300); } }); 参考方法: http://api.jqueryui.com/dialog/