V
V
vladya212019-09-02 23:19:35
AJAX
vladya21, 2019-09-02 23:19:35

Bootstrap, can't close and open modal via JS?

SOS!!! I can’t do it for 10 hours already. Help guys.
After a successful Ajax send, I want the bootstrap modal to close and the next one to open. Everything works, but when called, the slider does not disappear. When closing the 2nd modal, there is an offset of 15 px. Here is a link to rusli.site (you can see the problem by clicking download the price, and you shouldn't send a validator :) ) as I understand it, there is no access to aria-hidden="true" via $('#alertModal').modal('show' );
here is the code

$.ajax({
            url: 'handler.php',
            type: 'POST',
            data: form.serialize(),
            beforeSend: function() {
                answer.empty();
                button.attr('disabled', true).css('margin-bottom', '20px');
                loader.fadeIn();

            },
            success: function(result) {
                 $('#name').val('');
                 $('#email').val('');
                 $('#phone').val('');
                 $('#message').val('');
                $('#ZaModal').modal('hide');
                  $('#ZaModalCat').modal('hide');  
            $('#alertModal').modal('show');
   },

Answer the question

In order to leave comments, you need to log in

1 answer(s)
C
coderisimo, 2019-09-03
@vladya21

Try replacing : with

setTimeout(function(){
 $('#alertModal').modal('show'); 
    
},1000);

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question