Modal a ni
Bootstrap-a JavaScript modal plugin hmangin i site-ah dialog dah la, lightbox, user notification emaw, custom content kimchang emaw a awm thei ang.
A hnathawh dan
Bootstrap-a modal component i hman tan hmain a hnuaia mi hi chhiar hmasa phawt ang che, tun hnaia kan menu option te a danglam tawh avangin.
- Modal te hi HTML, CSS, leh JavaScript hmanga siam a ni. Document chhunga thil dang zawng zawng chungah an dah a, scroll atang chuan an paih chhuak a,
<body>
chutiang chuan modal content chu a scroll zawk ang. - Modal “backdrop” click chuan modal chu a khar nghal vek ang.
- Bootstrap hian modal window pakhat chauh a support a. Nested modal te hi user experience tha lo tak an nih kan rin avangin an support lo.
- Modals use
position: fixed
, chu chu a rendering chungchangah hian a chang chuan a bik deuh thei. A theih phawt chuan element dangte’n an tihbuai theih loh nan i modal HTML chu top-level position-ah dah la..modal
Fixed element dang chhunga a nest hunah issue i tawk mai thei . - Vawi khat chu , avang
position: fixed
hian mobile device-a modal hman chungchangah hian caveat thenkhat a awm bawk. A chipchiar zawkna chu kan browser support docs ah hian en rawh . - HTML5 hian a semantics a sawifiah dan avang hian HTML
autofocus
attribute hian Bootstrap modal-ah nghawng a nei lo. Chutiang bawka effect nei tur chuan custom JavaScript thenkhat hmang la:
const myModal = document.getElementById('myModal')
const myInput = document.getElementById('myInput')
myModal.addEventListener('shown.bs.modal', () => {
myInput.focus()
})
prefers-reduced-motion
media query ah a innghat a ni. Kan accessibility documentation a reduced motion tih hi en la
.
Demo leh hman dan tur kaihhruaina chhiar chhunzawm zel ang che.
Entirna te
Modal component hrang hrang te
A hnuaia tarlan te hi static modal entirnan (a position
leh display
have been overridden tihna a ni). A chhungah hian modal header, modal body (a mamawh tur padding
), leh modal footer (optional) te pawh a tel. A theih phawt chuan dismiss action nen modal header te dah tel turin kan ngen a, a nih loh leh dismiss action chiang tak dang pe turin kan ngen bawk.
<div class="modal" tabindex="-1">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">Modal title</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
<p>Modal body text goes here.</p>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
<button type="button" class="btn btn-primary">Save changes</button>
</div>
</div>
</div>
</div>
Live demo a ni ang
A hnuaia button hi click la, working modal demo chu toggle rawh. A hnuai lam a pan ang a, page chunglam atang chuan a fade in ang.
<!-- Button trigger modal -->
<button type="button" class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#exampleModal">
Launch demo modal
</button>
<!-- Modal -->
<div class="modal fade" id="exampleModal" tabindex="-1" aria-labelledby="exampleModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="exampleModalLabel">Modal title</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
...
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
<button type="button" class="btn btn-primary">Save changes</button>
</div>
</div>
</div>
</div>
Static backdrop a ni
Backdrop chu static-a dah a nih chuan modal chu a pawn lama click-naah a khar dawn lo. A hnuaia button hi click la, enchhin rawh.
<!-- Button trigger modal -->
<button type="button" class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#staticBackdrop">
Launch static backdrop modal
</button>
<!-- Modal -->
<div class="modal fade" id="staticBackdrop" data-bs-backdrop="static" data-bs-keyboard="false" tabindex="-1" aria-labelledby="staticBackdropLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="staticBackdropLabel">Modal title</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
...
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
<button type="button" class="btn btn-primary">Understood</button>
</div>
</div>
</div>
</div>
Content thui tak tak scroll
Modal te chu user viewport emaw device emaw atan a sei lutuk chuan page ngei atanga innghat lovin an scroll thin. Kan sawi tum chu a hnuaia demo hi han en teh.
Scrollable modal pawh i siam thei a, chu chuan modal body chu scroll theihna a siam a, chu .modal-dialog-scrollable
chu .modal-dialog
.
<!-- Scrollable modal -->
<div class="modal-dialog modal-dialog-scrollable">
...
</div>
Vertically centered a ni
Add .modal-dialog-centered
to .modal-dialog
ah chuan modal chu vertically center ah dah rawh.
<!-- Vertically centered modal -->
<div class="modal-dialog modal-dialog-centered">
...
</div>
<!-- Vertically centered scrollable modal -->
<div class="modal-dialog modal-dialog-centered modal-dialog-scrollable">
...
</div>
Tooltips leh popovers te pawh a awm bawk
Tooltip leh popover te chu a tul angin modal chhungah dah theih a ni. Modal khar a nih chuan a chhunga tooltip leh popover awm apiang chu automatic in a dismis vek bawk.
<div class="modal-body">
<h5>Popover in a modal</h5>
<p>This <a href="#" role="button" class="btn btn-secondary" data-bs-toggle="popover" title="Popover title" data-bs-content="Popover body content is set in this attribute.">button</a> triggers a popover on click.</p>
<hr>
<h5>Tooltips in a modal</h5>
<p><a href="#" data-bs-toggle="tooltip" title="Tooltip">This link</a> and <a href="#" data-bs-toggle="tooltip" title="Tooltip">that link</a> have tooltips on hover.</p>
</div>
Grid hmangin
Bootstrap grid system chu modal chhungah hmang la .container-fluid
, .modal-body
. Tichuan, hmun dangah i tih ang bawkin grid system class pangngai te chu hmang ang che.
<div class="modal-body">
<div class="container-fluid">
<div class="row">
<div class="col-md-4">.col-md-4</div>
<div class="col-md-4 ms-auto">.col-md-4 .ms-auto</div>
</div>
<div class="row">
<div class="col-md-3 ms-auto">.col-md-3 .ms-auto</div>
<div class="col-md-2 ms-auto">.col-md-2 .ms-auto</div>
</div>
<div class="row">
<div class="col-md-6 ms-auto">.col-md-6 .ms-auto</div>
</div>
<div class="row">
<div class="col-sm-9">
Level 1: .col-sm-9
<div class="row">
<div class="col-8 col-sm-6">
Level 2: .col-8 .col-sm-6
</div>
<div class="col-4 col-sm-6">
Level 2: .col-4 .col-sm-6
</div>
</div>
</div>
</div>
</div>
</div>
Modal content hrang hrang
Button bunch khat, modal khata trigger vek, content hrang hrang tlem nei? Use event.relatedTarget
leh HTML data-bs-*
attribute hmangin modal chhunga thu awmte chu eng button nge i click tih a zirin a danglam thei.
A hnuaiah hian live demo a awm a, chu chu entirnan HTML leh JavaScript a ni. Hriat belh duh chuan modal events docs chhiar la , relatedTarget
.
<button type="button" class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#exampleModal" data-bs-whatever="@mdo">Open modal for @mdo</button>
<button type="button" class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#exampleModal" data-bs-whatever="@fat">Open modal for @fat</button>
<button type="button" class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#exampleModal" data-bs-whatever="@getbootstrap">Open modal for @getbootstrap</button>
<div class="modal fade" id="exampleModal" tabindex="-1" aria-labelledby="exampleModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="exampleModalLabel">New message</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
<form>
<div class="mb-3">
<label for="recipient-name" class="col-form-label">Recipient:</label>
<input type="text" class="form-control" id="recipient-name">
</div>
<div class="mb-3">
<label for="message-text" class="col-form-label">Message:</label>
<textarea class="form-control" id="message-text"></textarea>
</div>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
<button type="button" class="btn btn-primary">Send message</button>
</div>
</div>
</div>
</div>
const exampleModal = document.getElementById('exampleModal')
exampleModal.addEventListener('show.bs.modal', event => {
// Button that triggered the modal
const button = event.relatedTarget
// Extract info from data-bs-* attributes
const recipient = button.getAttribute('data-bs-whatever')
// If necessary, you could initiate an AJAX request here
// and then do the updating in a callback.
//
// Update the modal's content.
const modalTitle = exampleModal.querySelector('.modal-title')
const modalBodyInput = exampleModal.querySelector('.modal-body input')
modalTitle.textContent = `New message to ${recipient}`
modalBodyInput.value = recipient
})
Modal hrang hrangah toggle theih a ni
data-bs-target
Modal tam tak inkarah toggle la , leh data-bs-toggle
attribute te chu clever placement engemaw zat nen . Entirnan, modal-a sign inhawng tawh chhung atang chuan password reset modal chu i toggle thei ang. Khawngaihin modal tam tak chu a rualin hawn theih a ni lo tih hre reng ang che —he method hian modal hrang hrang pahnih inkarah a toggle mai mai a ni.
<div class="modal fade" id="exampleModalToggle" aria-hidden="true" aria-labelledby="exampleModalToggleLabel" tabindex="-1">
<div class="modal-dialog modal-dialog-centered">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="exampleModalToggleLabel">Modal 1</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
Show a second modal and hide this one with the button below.
</div>
<div class="modal-footer">
<button class="btn btn-primary" data-bs-target="#exampleModalToggle2" data-bs-toggle="modal">Open second modal</button>
</div>
</div>
</div>
</div>
<div class="modal fade" id="exampleModalToggle2" aria-hidden="true" aria-labelledby="exampleModalToggleLabel2" tabindex="-1">
<div class="modal-dialog modal-dialog-centered">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="exampleModalToggleLabel2">Modal 2</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
Hide this modal and show the first with the button below.
</div>
<div class="modal-footer">
<button class="btn btn-primary" data-bs-target="#exampleModalToggle" data-bs-toggle="modal">Back to first</button>
</div>
</div>
</div>
</div>
<a class="btn btn-primary" data-bs-toggle="modal" href="#exampleModalToggle" role="button">Open first modal</a>
Animation thlak danglam rawh
Variable hian modal fade-in animation hmaa $modal-fade-transform
transform state a tichiang a, variable chuan modal fade-in animation tawp lamah transform of a ruat bawk..modal-dialog
$modal-show-transform
.modal-dialog
Entirnan zoom-in animation i duh chuan $modal-fade-transform: scale(.8)
.
Animation chu paih chhuak rawh
En tur fade in ai chuan modal lang mai mai tur tan chuan .fade
i modal markup atang khan class chu paih chhuak rawh.
<div class="modal" tabindex="-1" aria-labelledby="..." aria-hidden="true">
...
</div>
Dynamic sang tak tak a awm
Modal hawn laiin a san zawng a inthlak myModal.handleUpdate()
chuan scrollbar a rawn lang palh hlauh chuan modal awmna tur siamthat leh turin i call tur a ni.
A thlen theihna tur
aria-labelledby="..."
, modal title reference-in, -ah hian add ngei ang che .modal
. Tin, i modal dialog chungchang sawifiahna chu aria-describedby
on hmangin i pe thei .modal
bawk. role="dialog"
JavaScript hmanga kan add tawh avangin add a ngai lo tih hre reng ang che .
YouTube video te embedding a ni
YouTube video te chu modal-a embede tur chuan Bootstrap-a awm lo JavaScript dang a ngai a, chu chuan playback chu automatic-in a titawp thei a, thil dang tam tak a titawp thei bawk. Hrechiang duh tan he Stack Overflow post \angkai tak hi en la .
A duh duh size te pawh a awm bawk
Modal hian optional size pathum a nei a, modifier class kaltlangin a .modal-dialog
. Heng size te hi breakpoint thenkhatah an kick in a, chu chuan viewport tawi zawka horizontal scrollbar awm loh nan.
Lenzawng tehna | Pawl | Modal max-a zau zawng a ni |
---|---|---|
Te | .modal-sm |
300px |
Hlawhchhamna | Pakhatmah | 500px |
Hrawl | .modal-lg |
800px |
Extra lian tak a ni | .modal-xl |
1140px |
Kan default modal awm lo modifier class hian “medium” size modal a siam a.
<div class="modal-dialog modal-xl">...</div>
<div class="modal-dialog modal-lg">...</div>
<div class="modal-dialog modal-sm">...</div>
Fullscreen Modal hmanga siam a ni
Override dang chu user viewport khuhtu modal pop up theihna option a ni a, chu chu a -a dah modifier class hmanga hmuh theih a .modal-dialog
ni.
Pawl | A awm theihna tur | |
---|---|---|
.modal-fullscreen |
Englaipawhin | |
.modal-fullscreen-sm-down |
576px |
|
.modal-fullscreen-md-down |
768px |
|
.modal-fullscreen-lg-down |
992px |
|
.modal-fullscreen-xl-down |
1200px |
|
.modal-fullscreen-xxl-down |
1400px |
<!-- Full screen modal -->
<div class="modal-dialog modal-fullscreen-sm-down">
...
</div>
CSS a ni
Variables te pawh a awm
v5.2.0 ah dah belh a niBootstrap-in CSS variables approach a kalpui mek zingah hian modal-te chuan local CSS variables on .modal
leh .modal-backdrop
for enhanced real-time customization an hmang ta a ni. CSS variable hrang hrangte tana value te hi Sass hmanga set a nih avangin Sass customization pawh a la support reng bawk.
--#{$prefix}modal-zindex: #{$zindex-modal};
--#{$prefix}modal-width: #{$modal-md};
--#{$prefix}modal-padding: #{$modal-inner-padding};
--#{$prefix}modal-margin: #{$modal-dialog-margin};
--#{$prefix}modal-color: #{$modal-content-color};
--#{$prefix}modal-bg: #{$modal-content-bg};
--#{$prefix}modal-border-color: #{$modal-content-border-color};
--#{$prefix}modal-border-width: #{$modal-content-border-width};
--#{$prefix}modal-border-radius: #{$modal-content-border-radius};
--#{$prefix}modal-box-shadow: #{$modal-content-box-shadow-xs};
--#{$prefix}modal-inner-border-radius: #{$modal-content-inner-border-radius};
--#{$prefix}modal-header-padding-x: #{$modal-header-padding-x};
--#{$prefix}modal-header-padding-y: #{$modal-header-padding-y};
--#{$prefix}modal-header-padding: #{$modal-header-padding}; // Todo in v6: Split this padding into x and y
--#{$prefix}modal-header-border-color: #{$modal-header-border-color};
--#{$prefix}modal-header-border-width: #{$modal-header-border-width};
--#{$prefix}modal-title-line-height: #{$modal-title-line-height};
--#{$prefix}modal-footer-gap: #{$modal-footer-margin-between};
--#{$prefix}modal-footer-bg: #{$modal-footer-bg};
--#{$prefix}modal-footer-border-color: #{$modal-footer-border-color};
--#{$prefix}modal-footer-border-width: #{$modal-footer-border-width};
--#{$prefix}backdrop-zindex: #{$zindex-modal-backdrop};
--#{$prefix}backdrop-bg: #{$modal-backdrop-bg};
--#{$prefix}backdrop-opacity: #{$modal-backdrop-opacity};
Sass a danglam thei
$modal-inner-padding: $spacer;
$modal-footer-margin-between: .5rem;
$modal-dialog-margin: .5rem;
$modal-dialog-margin-y-sm-up: 1.75rem;
$modal-title-line-height: $line-height-base;
$modal-content-color: null;
$modal-content-bg: $white;
$modal-content-border-color: var(--#{$prefix}border-color-translucent);
$modal-content-border-width: $border-width;
$modal-content-border-radius: $border-radius-lg;
$modal-content-inner-border-radius: subtract($modal-content-border-radius, $modal-content-border-width);
$modal-content-box-shadow-xs: $box-shadow-sm;
$modal-content-box-shadow-sm-up: $box-shadow;
$modal-backdrop-bg: $black;
$modal-backdrop-opacity: .5;
$modal-header-border-color: var(--#{$prefix}border-color);
$modal-header-border-width: $modal-content-border-width;
$modal-header-padding-y: $modal-inner-padding;
$modal-header-padding-x: $modal-inner-padding;
$modal-header-padding: $modal-header-padding-y $modal-header-padding-x; // Keep this for backwards compatibility
$modal-footer-bg: null;
$modal-footer-border-color: $modal-header-border-color;
$modal-footer-border-width: $modal-header-border-width;
$modal-sm: 300px;
$modal-md: 500px;
$modal-lg: 800px;
$modal-xl: 1140px;
$modal-fade-transform: translate(0, -50px);
$modal-show-transform: none;
$modal-transition: transform .3s ease-out;
$modal-scale-transform: scale(1.02);
Suih
Responsive fullscreen modals$breakpoints
chu map leh loop in hmangin siam a scss/_modal.scss
ni.
@each $breakpoint in map-keys($grid-breakpoints) {
$infix: breakpoint-infix($breakpoint, $grid-breakpoints);
$postfix: if($infix != "", $infix + "-down", "");
@include media-breakpoint-down($breakpoint) {
.modal-fullscreen#{$postfix} {
width: 100vw;
max-width: none;
height: 100%;
margin: 0;
.modal-content {
height: 100%;
border: 0;
@include border-radius(0);
}
.modal-header,
.modal-footer {
@include border-radius(0);
}
.modal-body {
overflow-y: auto;
}
}
}
}
Hman dan tur
Modal plugin hian i thup thup chu a mamawh angin a toggle a, data attribute emaw JavaScript hmangin a toggle thei bawk. Default scrolling behavior pawh a override a .modal-backdrop
, modal pawn lama click hunah shown modals dismiss theihna tur click area pe turin a siam bawk.
Data attribute hmangin a ni
Toggle rawh
JavaScript ziak lovin modal pakhat activate rawh. data-bs-toggle="modal"
Controller element, button ang chi, a data-bs-target="#foo"
or href="#foo"
toggle tur modal bik target tur nen set rawh .
<button type="button" data-bs-toggle="modal" data-bs-target="#myModal">Launch modal</button>
Hnawl
Dismissal hi a hnuaia tarlan ang hian modal chhungadata
button pakhata attribute hmangin tih theih a ni :
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
emaw, a hnuaia tarlan ang hian modal pawn lama button-ah emaw data-bs-target
:
<button type="button" class="btn-close" data-bs-dismiss="modal" data-bs-target="#my-modal" aria-label="Close"></button>
JavaScript hmangin
JavaScript line khat hmangin modal siam rawh:
const myModal = new bootstrap.Modal(document.getElementById('myModal'), options)
// or
const myModalAlternative = new bootstrap.Modal('#myModal', options)
Thil thlan theih a ni
Options chu data attribute emaw JavaScript hmanga pass theih a nih avangin option hming chu data-bs-
, ah hian i append thei ang data-bs-animation="{value}"
. Data attribute hmanga options pass dawnin option hming case type chu “ camelCase ” atanga “ kebab-case ” ah thlak ngei ngei tur a ni. Entirnan, data-bs-custom-class="beautifier"
tih aiah hmang data-bs-customClass="beautifier"
rawh.
Bootstrap 5.2.0 atang khan component zawng zawng hian experimental reserved data attribute an support data-bs-config
a, chu chuan JSON string angin component configuration awlsam tak a dah thei a ni. Element pakhatin data-bs-config='{"delay":0, "title":123}'
leh data-bs-title="456"
attribute a neih chuan a tawp ber title
value chu a ni ang a 456
, data attribute hrang hrangte chuan , a value pekte chu a override ang data-bs-config
. Chu bakah, data attribute awmsa te hian JSON value te chu data-bs-delay='{"show":0,"hide":150}'
.
Hming | Lampang | Hlawhchhamna | Hrilhfiahna |
---|---|---|---|
backdrop |
boolean a ni a, .'static' |
true |
Modal-backdrop element a awm bawk. static A dang pawhin, click laiin modal khar lo backdrop atan specify bawk ang che. |
focus |
boolean a ni | true |
Initialized hunah modal ah focus a dah thin. |
keyboard |
boolean a ni | true |
Escape key i hmet chuan modal a khar thin. |
Thiltih dan tur
Asynchronous method leh inthlak danglamna te
API method zawng zawng hi asynchronous a ni a , transition a tan vek a ni . Transition an tan veleh mahse a tawp hmain call tu hnenah an kir leh thin . Chu bakah, transitioning component-a method call chu ngaihthah a ni ang .
Passing option hrang hrang a awm
I content chu modal angin a activate thin. A pawm a, optional options a awm object
bawk .
const myModal = new bootstrap.Modal('#myModal', {
keyboard: false
})
Tihdan | Hrilhfiahna |
---|---|
dispose |
Element pakhat modal a tichhia. (DOM element-a data dahkhawmte a paih chhuak) |
getInstance |
Static method hmanga DOM element nena inzawm modal instance hmuh theihna tur. |
getOrCreateInstance |
Static method hmanga DOM element nena inzawm modal instance hmuh theihna tur, a nih loh leh initialized a nih loh chuan a thar siam theihna tur. |
handleUpdate |
Modal hawn laiin a san zawng a inthlak chuan (chu chu scrollbar a rawn lang a nih chuan) modal awmna tur chu manual-in siam \ha leh rawh. |
hide |
Manual takin modal a thup thin. Modal a thup tak tak hmain (chu chu hidden.bs.modal event a thlen hma) caller hnenah a kir leh thin. |
show |
Manual takin modal a hawng thin. Modal a lan tak takshown.bs.modal hmain (chu chu event a thlen hmain ) caller hnenah a kir leh thin. Tin, DOM element chu modal events-a dawn theih tur argument atan i pass thei bawk ( relatedTarget property angin). ( const modalToggle = document.getElementById('toggleMyModal'); myModal.show(modalToggle) chu chu . |
toggle |
Modal pakhat chu manual in a toggle thin. Modal a lan tak tak hma emaw a thup hma emaw (chu chu shown.bs.modal or hidden.bs.modal event a thlen hma) caller hnenah a kir leh thin. |
Thil thlengte
Bootstrap-a modal class hian modal functionality-a hooking-na tur event tlemte a pholang a ni. Modal event zawng zawng hi modal ngeiah (ie at the <div class="modal">
).
Hunbik | Hrilhfiahna |
---|---|
hide.bs.modal |
hide He event hi instance method koh a nih chuan a fire nghal a ni. |
hidden.bs.modal |
He event hi modal chu user hnen atanga thup a nih zawh chuan a fire thin (CSS transitions zawh hun a nghak ang). |
hidePrevented.bs.modal |
He event hi modal a lan hian a fire a, a backdrop a awm a static , modal pawn lama click a awm bawk. Escape key i hmet a, keyboard option chu a set chuan event chu a fire bawk false . |
show.bs.modal |
show He event hi instance method kan koh chuan a fire nghal vek a ni. Click avanga lo awm a nih chuan click element chu relatedTarget event property atan a awm thei. |
shown.bs.modal |
He event hi modal chu user hmuh theiha siam a nih hunah fire a ni (CSS transition zawh hun a nghak ang). Click avanga lo awm a nih chuan click element chu relatedTarget event property atan a awm thei. |
const myModalEl = document.getElementById('myModal')
myModalEl.addEventListener('hidden.bs.modal', event => {
// do something...
})