$(function() {
$( "#Dialog1" ).dialog({
resizable: false
});
if($( "#Dialog1" ).dialog( "isOpen" )){
setTimeout(function(){
$( "#Dialog1" ).dialog( "option", "hide", {
effect: "explode",
duration: 1000
} )
}, 5000)}
});
});
它需要在5秒后销毁对话框,但什么也没发生。
答案 0 :(得分:0)
您的代码存在一些问题:
}
setTimeout
)
之后,你还有一个}
"option"
close
或destroy
方法$(function() {
$( "#Dialog1" ).dialog({
resizable: false
});
if( $( "#Dialog1" ).dialog( "isOpen" ) ){
setTimeout(function(){
$( "#Dialog1" ).dialog( "close" );
}, 5000);
}
});