“Open Bootstrap Modal z JavaScript” Kod odpowiedzi

OnClick Open Modal JQuery

$('#myModal').modal('toggle');
$('#myModal').modal('show');
$('#myModal').modal('hide');
Cheerful Chimpanzee

Open Bootstrap Modal z JavaScript

$("#myModal").modal()
Elated Elephant

Bootstrap Modal Open Event

$('#code').on('shown.bs.modal', function (e) {
  // do something...
})
Rouani Ayoub

Modalny kod bootstrap

<div class="modal" tabindex="-1" role="dialog">
  <div class="modal-dialog" role="document">
    <div class="modal-content">
      <div class="modal-header">
        <h5 class="modal-title">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">
        <p>Modal body text goes here.</p>
      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-primary">Save changes</button>
        <button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
      </div>
    </div>
  </div>
</div>
Obedient Opossum

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

Bootstrap 4 start modalny w modelu

var modal_lv = 0;
$('.modal').on('shown.bs.modal', function (e) {
    $('.modal-backdrop:last').css('zIndex',1051+modal_lv);
    $(e.currentTarget).css('zIndex',1052+modal_lv);
    modal_lv++
});

$('.modal').on('hidden.bs.modal', function (e) {
    modal_lv--
});
Expensive Elephant

Odpowiedzi podobne do “Open Bootstrap Modal z JavaScript”

Pytania podobne do “Open Bootstrap Modal z JavaScript”

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

Przeglądaj inne języki kodu