M
M
Markus Seifert2017-02-12 13:28:37
Bootstrap
Markus Seifert, 2017-02-12 13:28:37

How to call modal window from modal window (Bootstrap 3)?

When a modal is called from a modal (... I understand everything, but so), the second one called is cut off and the page "under" the modal window scrolls instead.
I apologize for the tongue-tied tongue :)
There were already such questions on the Toaster, but I didn’t figure it out (I’m not smart) ... Who has a ready-made solution?

Bootstrap 3, how to fix parent page on tricky modal call?
What is the correct way to call a modal window inside another modal in Bootstrap?
How to open multiple bootstrap modals at once?

I call the second
<a href="#registration" data-toggle="modal" data-dismiss="modal">Register a>

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Sergey delphinpro, 2017-02-12
@Ruler_of_Olympus

codepen.io/anon/pen/dNwOVv
The whole trick is in the code

$(document).on('hidden.bs.modal', '.modal', function () {
    $('.modal:visible').length && $(document.body).addClass('modal-open');
});

B
Boris Korobkov, 2017-10-02
@BorisKorobkov

you need to search either until the symbol # or until the end of the line

So write at the end of the regular expression:(#|$)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question