2010-02-08 66 views
43

有誰知道如何讓jQuery對話框不可調整大小? 此刻,我稱此:如何使jQuery UI對話框不可調整大小

var elem = $("#mydiv"); 
elem.dialog({ 
    modal: true, 
    title: 'title', 
    buttons: { 
    Ok: function() { 
     $(this).dialog('close'); 
    } // end function for Ok button 
    } // end buttons 
}); // end dialog 
elem.dialog('open') 

回答

98

使用resizable選項

var elem = $("#mydiv"); 
elem.dialog({ 
    modal: true, 
    resizable: false, 
    title: 'title', 
    buttons: { 
     Ok: function() { 
      $(this).dialog('close'); 
     } //end function for Ok button 
    }//end buttons 
});  // end dialog 
elem.dialog('open'); 
6

或者乾脆:

$('#mydiv').dialog({resizable: false});