如何在一定时间后销毁对话框?????
这是我的代码:
<script type="text/javascript">
$(function() {
$(".dialog-message").dialog({
modal: true,
buttons: {
Ok: function() {
$(this).dialog('close');
}
}
});
});
</script>
答案 0 :(得分:4)
$(function() {
var dialog = $(".dialog-message").dialog({
modal: true,
buttons: {
Ok: function() {
$(this).dialog('close');
}
}
});
setTimeout(function(){
dialog.dialog('destroy');
},5000); // 5 seconds
});
答案 1 :(得分:0)
function destroyDialog() {
$(".dialog-message.").dialog("destroy");
}
setTimeout("destroyDialog()", 1000);
这是在1秒后,1000毫秒......