如何使 jQuery UI 对话框不可调整大小

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/2220799/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-26 13:02:53  来源:igfitidea点击:

How to make jQuery UI dialog not resizable

jqueryjquery-uijquery-ui-dialog

提问by Omu

Does anybody know how to make the jQuery dialog non-resizable ? At the moment, I call this:

有人知道如何使 jQuery 对话框不可调整大小吗?目前,我称之为:

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')

回答by rahul

Use the resizableoption

使用可调整大小的选项

 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');

回答by Bob

Or simply:

或者干脆:

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