我成功创建了一个带有调整大小启用的对话框但是对于我的项目,我需要在用户调整大小后打开对话框的高度和宽度.
我创建了一个id = opener的按钮和一个id = dialog的div.有人可以帮助我.
使用Javascript:
// increase the default animation speed to exaggerate the effect
$.fx.speeds._default = 1000;
$(function()
{
$( "#dialog" ).dialog(
{
modal:true,
autoOpen: false,
show: "blind",
hide: "explode",
buttons: [
{
text: "Ok",
click: function() { $(this).dialog("close"); }
}] ,
resizable: true,
width:'auto',
height:'auto'
});
$( "#opener" ).click(function()
{
$( "#dialog" ).dialog( "open" );
return false;
});
});
Run Code Online (Sandbox Code Playgroud)
HTML:
<body>
<div class="demo">
<div id="dialog" title="Basic dialog">
<p>My content here. I want to show the height …Run Code Online (Sandbox Code Playgroud)