jQuery - UI Dialog - looking for a smart solution for a timed close
- by AnApprentice
Hello, I wrote the following:
// Called with setTimeout(magicDialogDelayedClose, 2500);
function magicDialogDelayedClose() {
$(".ui-dialog").fadeOut(function() {
dialog_general.dialog('close');
});
}
The above is called with setTimeout when I show a notice dialog that I want to auto close in 2.5 secs.
The problem I'm noticing with this is that if the use Manually closes a dialog this timer still is running. If the user then opens a new dialog (which is very possible) the timer can then close that NEW dialog.
What's a smart way to handle this?j