Bootstrap modal hide old and open new

linkaiyi
Follow

I am using Bootstrap 4.1.1 and jQuery 3.3.1, and faced the same problem. 50ms didn’t solved the problem. So, i had to bump it upto 500ms, and it worked!

//hide first
$('#modal1').modal('hide');
//add delay when showing next modal
setTimeout(function () {
  $('#modal2').modal('show');
}, 500);
if (!$('body').hasClass('modal-open')) {
    $('body').addClass('modal-open')
}
Object has 0 attachments

Was this article helpful?

This article is viewed 49 times!

Recent Viewed Articles

0 Comments

Leave a Comment

Support