Reputation: 1703
How can I toggle the following alert to be closed after 2 sec?
<div class="alert alert-info">
<a href="#" class="close" data-dismiss="alert">×</a>
Success message
</div>
Upvotes: 1
Views: 276
Reputation: 627
Try like following:
$('#alert').fadeIn('slow').delay(2000).fadeOut('slow');
Good luck!
Upvotes: 2