我正在尝试创建一个模式对话框来显示内容(某种或其他类型的html):
<script>
$.fx.speeds._default = 1000;
$(function() {
$( "#dialog" ).dialog({
autoOpen: false,
closeOnEscape: true,
modal: true,
position: 'center',
width: 800,
height: 600,
show: "blind",
hide: "explode"
});
$( "#opener" ).click(function() {
$( "#dialog" ).dialog( "open" );
return false;
});
});
</script>
Run Code Online (Sandbox Code Playgroud)
当我查看页面时,对话框是内联的而不是隐藏的.这是我的HTML:
<div id="dialog">This is my dialog that should be hidden until called</div>
<button id="opener">I Open the Dialog</button>
Run Code Online (Sandbox Code Playgroud)
我究竟做错了什么?