$('#dlg').dialog('resize');
$(window).resize(function() { if(this.resizeTO) clearTimeout(this.resizeTO); this.resizeTO = setTimeout(function() { $(this).trigger('resizeEnd'); }, 500);});$(window).bind('resizeEnd', function() { //reset to modal - because my dialog isn't resizable $('#dlg').dialog({ modal: true });});
$('#dlg').dialog('center');