D
D
Dino1242014-06-08 07:31:45
HTML
Dino124, 2014-06-08 07:31:45

Why does "modal" close immediately after opening? DLE. Bootstrap

Faced a problem, when a modal window is called, it immediately closes and the page is updated.
Here is the window source:

<center><footer><div class="modal fade" id="foo" tabindex="1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
  <div class="modal-dialog">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
        <h4 class="modal-title" id="myModalLabel">Modal title</h4>
      </div>
      <div class="modal-body">
        ...
      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
        <button type="button" class="btn btn-primary">Save changes</button>
      </div>
    </div>
  </div>

Window call source:
<button class="btn btn-success" data-toggle="modal" data-target="#foo">
  Launch demo modal
</button>

jQuery, bootsrtap.js, bootstrap.min.js included Here is
an example: t5-craft.ru

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
snetcher, 2015-06-08
@snetcher

better late than never...
bootsrtap.js and bootstrap.min.js are the same library, so the modal call is handled twice, i.e. The window opens and then closes. Leave only bootstrap.min.js and everything will work.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question