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