try this!
$(function() {
var maxHeight = $(window).height();
$(window).resize(function(){
maxHeight = $(this).height();
$( "#myDialogContainer" ).dialog( "option", "height", maxHeight );
});
$( "#myDialogContainer" ).dialog({
resizable: false,
height: maxHeight,
modal: true,
buttons: {
"Delete all items": function() {
$( this ).dialog( "close" );
},
Cancel: function() {
$( this ).dialog( "close" );
}
}
});
});