“Otwórz modalny bootstrap” Kod odpowiedzi

Bootstrap Modal

<!-- Button trigger modal -->
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#exampleModalCenter">
  Launch demo modal
</button>

<!-- Modal -->
<div class="modal fade" id="exampleModalCenter" tabindex="-1" role="dialog" aria-labelledby="exampleModalCenterTitle" aria-hidden="true">
  <div class="modal-dialog modal-dialog-centered" role="document">
    <div class="modal-content">
      <div class="modal-header">
        <h5 class="modal-title" id="exampleModalLongTitle">Modal title</h5>
        <button type="button" class="close" data-dismiss="modal" aria-label="Close">
          <span aria-hidden="true">×</span>
        </button>
      </div>
      <div class="modal-body">
        ...
      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
        <button type="button" class="btn btn-primary">Save changes</button>
      </div>
    </div>
  </div>
</div>
AhmedElkaiass

Jak pokazać modal bootstrap

<script>
    var myModal = new bootstrap.Modal(document.getElementById('ModalID'))
    myModal.show()
</script>
MD SAIFUL ISLAM

Otwórz modalny bootstrap

//This event fires immediately when the show instance method is called. 
$('#myModal').on('show.bs.modal', function (e) {
  // do something...
});

//This event is fired when the modal has been made visible to the user
$('#myModal').on('shown.bs.modal', function (e) {
  // do something...
});

//This event is fired immediately when the hide instance method has been called.
$('#myModal').on('hide.bs.modal', function (e) {
  // do something...
});

//This event is fired when the modal has finished being hidden
$('#myModal').on('hidden.bs.modal', function (e) {
  // do something...
})
Yousef Qaoud

Odpowiedzi podobne do “Otwórz modalny bootstrap”

Pytania podobne do “Otwórz modalny bootstrap”

Więcej pokrewnych odpowiedzi na “Otwórz modalny bootstrap” w JavaScript

Przeglądaj popularne odpowiedzi na kod według języka

Przeglądaj inne języki kodu