scientiffic
scientiffic

Reputation: 9415

Bootstrap Hide Modal After Delay

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

Answers (1)

Nathan Harkenrider
Nathan Harkenrider

Reputation: 566

Try wrapping the call to modal in a function.

setTimeout(function() { $('.embedModal').modal('hide'); }, 3000);

Upvotes: 16

Related Questions