Answers for "bootstrap how to listen if modal is open"

0

bootstrap modal show event

$('#code').on('shown.bs.modal', function (e) {
  // do something...
})
Posted by: Guest on June-03-2021
0

how to check if bootstrap modal is open

($("element").data('bs.modal') || {})._isShown    // Bootstrap 4
($("element").data('bs.modal') || {}).isShown     // Bootstrap <= 3

// or, with the optional chaining operator (?.)
$("element").data('bs.modal')?._isShown    // Bootstrap 4
$("element").data('bs.modal')?.isShown     // Bootstrap <= 3
Posted by: Guest on August-06-2021

Code answers related to "bootstrap how to listen if modal is open"

Code answers related to "Javascript"

Browse Popular Code Answers by Language