When you create a modal bootstap window, it closes immediately after opening. Inside the youtube video window. How to fix? The window opens after clicking not on the button, but on the link.

Update

Thanks for responding! I do not understand: everything is displayed normally through jsfiddle. Maybe conflicts? I use the bootstrap in dle. Are there any suggestions? On the page I still use fixed navbar http://jsfiddle.net/8hz1c733/

Just in case. Maybe I have an outdated jquery library? Or do you need to connect something to support html-5?

    2 answers 2

    The problem with <a href="#"></a> , the link to open a window in the new bootstrap version works through the data-target , so the developers decided not to block the work of a normal link, and it is triggered when pressed.

    Solution: remove href="#" from the link and set the cursor: pointer in the css element to make the link look like a link. In principle, the <a> tag can now not be used for modal windows at all.

      http://jsfiddle.net/8hz1c733/ - here two times the same script is connected, delete bootstrap.modal.js

      In bootstrap.min.js, a modal window has already been implemented. It turns out that the script is triggered twice: first it opens and then immediately closes, because the window is closed and the button of the modal window was pressed.