jQuery dialog open and automatically close after 3 seconds
If you also want to add some transitions I wouldn't recommend jQuery slideUp and slideDown animations. Those are slow since it uses CPU instead of GPU and the animations themselves don't feel totally right.
I would recommend Velocity.js instead. Remember to also add Velocity UI js. And you could do something like this:
$( "#your-modal-id" ).velocity('transition.slideUpBigOut', { delay: 3000 })
Use the jQuery delay function e.g.
$( "#your-modal-id" ).slideDown( 300 ).delay( 800 ).slideUp( 400 );
You should use setTimeout
:
open: function(event, ui) {
setTimeout(function(){
$('#dialog').dialog('close');
}, 3000);
}
Here's the fiddle: http://jsfiddle.net/WrdM9/2/