Reputation: 9415
I'm trying to hide a bootstrap modal after a delay (~3 seconds). I tried the following, none of which had any visible effect:
$(".embedModal").delay(3000).modal('hide');
setTimeout($('.embedModal').modal('hide'),3000);
How can I add a short delay before hiding the modal?
Upvotes: 3
Views: 12719
Reputation: 566
Try wrapping the call to modal in a function.
setTimeout(function() { $('.embedModal').modal('hide'); }, 3000);
Upvotes: 16