[solved] How to autoclose a jquery ui dialog with timeout?
hello, i am very new to jquery.
there is one thing i can not get working.
how can i autocloe a dialog?
- $(document).ready(function() {
var $dialog2 = $('<div></div>')
.html('Wollen Sie sich abmelden?')
.dialog({
autoOpen: false,
title: 'Abmelden',
resizable: true,
show: 'fade',
hide: 'explode',
height:140,
modal: true,
buttons: {
"Abmelden": function() {
$( this ).dialog( "close" );
},
"Abbrechen": function() {
$( this ).dialog( "close" );
}
}
});
$('#LogoutDialog').click(function() {
$dialog2.dialog('open');
setTimeout($dialog2.dialog("close"), 5000);
// prevent the default action, e.g., following a link
return false;
});
});
but, this closes the dialog immediately with no time out.
it does not wait 5 seconds :-(
what am i doing wrong?
thx for any help.