How can I destroy the dialog after confirming the number of seconds?
This is my code:
<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);
This happens after 1 second, 1000 milliseconds ...