Boot modal attenuation using jquery / css

I have a form inside bootstrap modal. I wake up using jQuery $ (ModalId) .modal ('show');

I do not want him to disappear. So, I did not add the "fade" class to my modal. after submitting the form in modal form. I want to loosen the modality.

$(modalId).modal('hide');

I used the above code segment to hide the modal, it works. But the modality goes away very quickly. I want him to disappear for a few seconds. How can i achieve this?

My code is:

$('.save').on('click', function(){
 setTimeout(function(){

  $('#div_dbReadMany').modal("hide");

 }, 1500);
});

Fiddle

+4
source share
2 answers

I found a solution by adding a delay to slow the modality and increase the latency by

$(modalId).modal('hide');

The code is here:

 $('.save').on('click', function(){

  $('#div_dbReadMany').delay(1000).fadeOut(450);

  setTimeout(function(){
    $('#div_dbReadMany').modal("hide");
  }, 1500);

 });
+2

.

$('.save').on('click', function(){
   $('#div_dbReadMany').delay(1000).fadeOut('slow');
   setTimeout(function() {
       $("#div_dbReadMany").modal('hide');
   }, 1500);
});

DEMO

+3

Source: https://habr.com/ru/post/1623619/


All Articles