Popovers
Akwụkwọ na ihe atụ maka ịgbakwunye popovers Bootstrap, dị ka ndị ahụ dị na iOS, na mmewere ọ bụla na saịtị gị.
Nchịkọta
Ihe ị ga-ama mgbe ị na-eji ngwa mgbakwunye popover:
- Popovers na-adabere na ọba akwụkwọ ndị ọzọ Popper maka idowe. Ị ga-agụnye popper.min.js tupu
bootstrap.js
, ma ọ bụ jiribootstrap.bundle.min.js
nke nwere Popper. - Popovers chọrọ ngwa mgbakwunye popover ka ndabere.
- Popovers abanyela maka ebumnuche arụmọrụ, yabụ ị ga-ebido ya n'onwe gị .
- Ogologo efu
title
nacontent
ụkpụrụ agaghị egosi popover. - Ezipụta
container: 'body'
ka ịzenarị nsogbu n'ime ihe ndị dị mgbagwoju anya (dị ka otu ntinye anyị, otu bọtịnụ, wdg). - Ịkpalite popovers na ihe zoro ezo agaghị arụ ọrụ.
- Popovers maka
.disabled
ma ọ bụdisabled
ọcha ga-akpalite na ihe mkpuchi. - Mgbe a kpalitere site na arịlịka nke kechie n'ofe ahịrị dị iche iche, popovers ga-adị n'etiti obosara nke arịlịka n'ozuzu ya. Jiri
.text-nowrap
na<a>
s gị zere omume a. - A ghaghị izobe ihe ndị na-ebupụta ihe tupu e wepụ ihe ndị kwekọrọ na DOM.
- Enwere ike ịkpalite popovers n'ihi ihe dị n'ime onyinyo DOM.
prefers-reduced-motion
ajụjụ mgbasa ozi. Hụ akụkụ
ngagharị ewelatala nke akwụkwọ nnweta anyị .
Nọgide na-agụ ka ịhụ ka popovers si arụ ọrụ na atụ ụfọdụ.
Ihe atụ
Kwado popovers
Dịka e kwuru n'elu, ị ga-eburịrị popovers tupu enwee ike iji ya. Otu ụzọ isi bido popovers niile na ibe ga-abụ ịhọrọ ha site na data-bs-toggle
njirimara ha, dịka:
const popoverTriggerList = document.querySelectorAll('[data-bs-toggle="popover"]')
const popoverList = [...popoverTriggerList].map(popoverTriggerEl => new bootstrap.Popover(popoverTriggerEl))
Ihe ngosi dị ndụ
Anyị na-eji Javascript yiri snippet dị n'elu iji mee popover ndị a dị ndụ. A na-edozi aha site data-bs-title
na ma hazie ọdịnaya ahụ site na data-bs-content
.
title
ọ bụ
data-bs-title
na HTML gị. Mgbe
title
ejiri ya, Popper ga-eji dochie ya na-akpaghị aka
data-bs-title
mgbe emepụtara mmewere.
<button type="button" class="btn btn-lg btn-danger" data-bs-toggle="popover" data-bs-title="Popover title" data-bs-content="And here's some amazing content. It's very engaging. Right?">Click to toggle popover</button>
Ụzọ anọ
Nhọrọ anọ dị: elu, aka nri, ala na aka ekpe. A na-egosipụta ntụzịaka mgbe ị na-eji Bootstrap na RTL. Tọọ data-bs-placement
ịgbanwe ntụzịaka.
<button type="button" class="btn btn-secondary" data-bs-container="body" data-bs-toggle="popover" data-bs-placement="top" data-bs-content="Top popover">
Popover on top
</button>
<button type="button" class="btn btn-secondary" data-bs-container="body" data-bs-toggle="popover" data-bs-placement="right" data-bs-content="Right popover">
Popover on right
</button>
<button type="button" class="btn btn-secondary" data-bs-container="body" data-bs-toggle="popover" data-bs-placement="bottom" data-bs-content="Bottom popover">
Popover on bottom
</button>
<button type="button" class="btn btn-secondary" data-bs-container="body" data-bs-toggle="popover" data-bs-placement="left" data-bs-content="Left popover">
Popover on left
</button>
Omenalacontainer
Mgbe ị nwere ụdị ụfọdụ na mmewere nne na nna na-egbochi popover, ị ga-achọ ịkọwapụta omenala container
ka HTML popover wee pụta n'ime mmewere ahụ kama. Nke a na-emekarị na tebụl na-anabata, otu ntinye, na ihe ndị yiri ya.
const popover = new bootstrap.Popover('.example-popover', {
container: 'body'
})
Ọnọdụ ọzọ ebe ị ga-achọ ịtọ omenala doro anya container
bụ popovers n'ime a modal dialog , iji jide n'aka na popover n'onwe ya na-agbakwunyere na modal. Nke a dị mkpa karịsịa maka popovers nwere ihe ndị na-emekọrịta ihe - modal dialogs ga-ejide nlebara anya, ya mere ọ gwụla ma popover bụ ihe nwatakịrị nke modal, ndị ọrụ agaghị enwe ike ilekwasị anya ma ọ bụ mee ka ihe ndị a na-emekọrịta ihe.
const popover = new bootstrap.Popover('.example-popover', {
container: '.modal-body'
})
Popovers omenala
Agbakwunyere na v5.2.0Ị nwere ike hazie ọdịdị popovers site na iji mgbanwe CSS . Anyị na-edobe klaasị ọpụrụiche data-bs-custom-class="custom-popover"
iji gbasaa ọdịdị omenala anyị wee jiri ya kagbuo ụfọdụ mgbanwe CSS mpaghara.
.custom-popover {
--bs-popover-max-width: 200px;
--bs-popover-border-color: var(--bs-primary);
--bs-popover-header-bg: var(--bs-primary);
--bs-popover-header-color: var(--bs-white);
--bs-popover-body-padding-x: 1rem;
--bs-popover-body-padding-y: .5rem;
}
<button type="button" class="btn btn-secondary"
data-bs-toggle="popover" data-bs-placement="right"
data-bs-custom-class="custom-popover"
data-bs-title="Custom popover"
data-bs-content="This popover is themed via CSS variables.">
Custom popover
</button>
Wepụ na ịpị ọzọ
Jiri focus
mkpalite chụpụ popovers na ọpịpị ọzọ onye ọrụ nke ihe dị iche karịa mmewere mgbanwe.
Akara akara akọwapụtara achọrọ maka ịchụpụ-na-esote-pịa
Maka ezigbo ihe nchọgharị na omume cross-platform, ị ga-eji <a>
mkpado, ọ bụghị mkpado <button>
, na ị ga-etinyerịrị tabindex
àgwà.
<a tabindex="0" class="btn btn-lg btn-danger" role="button" data-bs-toggle="popover" data-bs-trigger="focus" data-bs-title="Dismissible popover" data-bs-content="And here's some amazing content. It's very engaging. Right?">Dismissible popover</a>
const popover = new bootstrap.Popover('.popover-dismiss', {
trigger: 'focus'
})
Ihe ndị nwere nkwarụ
Ihe ndị nwere disabled
njirimara ahụ anaghị emekọrịta ihe, nke pụtara na ndị ọrụ enweghị ike ịnyagharị ma ọ bụ pịa ha ka ha kpalite popover (ma ọ bụ Tooltip). Dị ka ihe na-arụ ọrụ, ị ga-achọ ịkpalite popover site na ihe mkpuchi <div>
ma ọ bụ <span>
, nke emebere nke ọma na ahụigodo-elekwasị anya na iji tabindex="0"
.
Maka ihe mkpalite popover nwere nkwarụ, ị nwekwara ike ịhọrọ data-bs-trigger="hover focus"
ka popover pụta dị ka nzaghachi anya ozugbo nye ndị ọrụ gị ka ha nwere ike ọ gaghị atụ anya ịpị ihe nwere nkwarụ.
<span class="d-inline-block" tabindex="0" data-bs-toggle="popover" data-bs-trigger="hover focus" data-bs-content="Disabled popover">
<button class="btn btn-primary" type="button" disabled>Disabled button</button>
</span>
CSS
Mgbanwe
Agbakwunyere na v5.2.0Dịka akụkụ nke ụzọ mgbanwe mgbanwe CSS nke Bootstrap, popovers na-eji mgbanwe CSS mpaghara .popover
emeziwanye nhazi oge. A na-edozi ụkpụrụ maka mgbanwe CSS site na Sass, yabụ ka na-akwado nhazi Sass, kwa.
--#{$prefix}popover-zindex: #{$zindex-popover};
--#{$prefix}popover-max-width: #{$popover-max-width};
@include rfs($popover-font-size, --#{$prefix}popover-font-size);
--#{$prefix}popover-bg: #{$popover-bg};
--#{$prefix}popover-border-width: #{$popover-border-width};
--#{$prefix}popover-border-color: #{$popover-border-color};
--#{$prefix}popover-border-radius: #{$popover-border-radius};
--#{$prefix}popover-inner-border-radius: #{$popover-inner-border-radius};
--#{$prefix}popover-box-shadow: #{$popover-box-shadow};
--#{$prefix}popover-header-padding-x: #{$popover-header-padding-x};
--#{$prefix}popover-header-padding-y: #{$popover-header-padding-y};
@include rfs($popover-header-font-size, --#{$prefix}popover-header-font-size);
--#{$prefix}popover-header-color: #{$popover-header-color};
--#{$prefix}popover-header-bg: #{$popover-header-bg};
--#{$prefix}popover-body-padding-x: #{$popover-body-padding-x};
--#{$prefix}popover-body-padding-y: #{$popover-body-padding-y};
--#{$prefix}popover-body-color: #{$popover-body-color};
--#{$prefix}popover-arrow-width: #{$popover-arrow-width};
--#{$prefix}popover-arrow-height: #{$popover-arrow-height};
--#{$prefix}popover-arrow-border: var(--#{$prefix}popover-border-color);
Sass variables
$popover-font-size: $font-size-sm;
$popover-bg: $white;
$popover-max-width: 276px;
$popover-border-width: $border-width;
$popover-border-color: var(--#{$prefix}border-color-translucent);
$popover-border-radius: $border-radius-lg;
$popover-inner-border-radius: subtract($popover-border-radius, $popover-border-width);
$popover-box-shadow: $box-shadow;
$popover-header-font-size: $font-size-base;
$popover-header-bg: shade-color($popover-bg, 6%);
$popover-header-color: $headings-color;
$popover-header-padding-y: .5rem;
$popover-header-padding-x: $spacer;
$popover-body-color: $body-color;
$popover-body-padding-y: $spacer;
$popover-body-padding-x: $spacer;
$popover-arrow-width: 1rem;
$popover-arrow-height: .5rem;
Ojiji
Kwado popovers site na Javascript:
const exampleEl = document.getElementById('example')
const popover = new bootstrap.Popover(exampleEl, options)
Ime popovers na-arụ ọrụ maka ahụigodo yana ndị ọrụ teknụzụ enyemaka
Iji mee ka ndị ọrụ ahụigodo mee ka popovers gị rụọ ọrụ, ị ga-etinye naanị ya na ihe HTML bụ nke a na-eme n'ọdịnala kiiboodu na mmekọrịta (dị ka njikọ ma ọ bụ njikwa ụdị). Ọ bụ ezie na ihe HTML aka ike (dị ka <span>
s) nwere ike ime ka a na-elekwasị anya site n'ịgbakwunye tabindex="0"
àgwà ahụ, nke a ga-agbakwunye nkwụsị nke nwere ike iwe iwe na mgbagwoju anya na ihe ndị na-adịghị emekọrịta ihe maka ndị ọrụ keyboard, na ọtụtụ teknụzụ enyemaka anaghị ekwupụta ọdịnaya popover n'ọnọdụ a. . Na mgbakwunye, adaberela naanị dị hover
ka ihe na-akpalite popovers gị, n'ihi na nke a ga-eme ka ha ghara ịkpalite ndị ọrụ ahụigodo.
Ọ bụ ezie na ị nwere ike ịtinye ọgaranya, HTML ahaziri ahazi na popovers na html
nhọrọ, anyị na-akwadosi ike ka ị zere itinye oke ọdịnaya. Ụzọ popovers na-arụ ọrụ ugbu a bụ na, ozugbo egosipụtara, ọdịnaya ha na-ejikọta na ihe na-akpalite ya na aria-describedby
àgwà ahụ. N'ihi ya, a ga-akpọsa ndị ọrụ teknụzụ na-enyere aka na ọdịnaya popover niile dị ka iyi ogologo na-akwụsịghị akwụsị.
Na mgbakwunye, ebe ọ ga-ekwe omume ịgụnye njikwa mmekọrịta (dị ka ụdị ụdị ma ọ bụ njikọ) na popover gị (site n'ịgbakwunye ihe ndị a na allowList
njirimara na mkpado ekwenyere), mara na ugbu a popover anaghị ejikwa usoro nlebara anya keyboard. Mgbe onye ọrụ ahụigodo meghere popover, a na-elekwasị anya na ihe na-akpalite, na ebe ọ bụ na popover anaghị agbaso ihe mkpalite na nhazi akwụkwọ ahụ ozugbo, enweghị nkwa na ịga n'ihu / ịpị.TABga-ebugharị onye ọrụ ahụigodo n'ime popover n'onwe ya. Na nkenke, naanị ịgbakwụnye njikwa mmekọrịta na popover nwere ike ime ka njikwa ndị a ghara ịnweta/enweghị ike iji ya maka ndị ọrụ keyboard na ndị na-eji teknụzụ enyemaka, ma ọ bụ ma ọ dịkarịa ala mee ka usoro elekwasị anya na-ezighi ezi. N'okwu ndị a, tụlee iji modal dialog kama.
Nhọrọ
Dịka enwere ike ịfefe nhọrọ site na njirimara data ma ọ bụ Javascript, ị nwere ike itinye aha nhọrọ na data-bs-
, dịka na data-bs-animation="{value}"
. Gbaa mbọ hụ na ị gbanwee ụdị ikpe nke aha nhọrọ site na " camelCase " gaa na " kebab-case " mgbe ị na-agafe nhọrọ site na njirimara data. Dịka ọmụmaatụ, jiri data-bs-custom-class="beautifier"
kama data-bs-customClass="beautifier"
.
Dịka nke Bootstrap 5.2.0, akụrụngwa niile na-akwado njirimara data echekwara nnwaledata-bs-config
nke nwere ike idobe nhazi akụrụngwa dị mfe dị ka eriri JSON. Mgbe mmewere nwere data-bs-config='{"delay":0, "title":123}'
na data-bs-title="456"
njiri mara, uru ikpeazụ title
ga-abụ 456
na njirimara data dị iche ga-ewepụ ụkpụrụ enyere na data-bs-config
. Na mgbakwunye, njirimara data dị adị nwere ike idobe ụkpụrụ JSON dịka data-bs-delay='{"show":0,"hide":150}'
.
sanitize
,
sanitizeFn
, na
nhọrọ site na iji njirimara data.allowList
Aha | Ụdị | Ọdabara | Nkọwa |
---|---|---|---|
allowList |
ihe | Uru ndabara | Ihe nke nwere njirimara na mkpado ekwenyere. |
animation |
boolean | true |
Tinye mgbanwe mgbanwe CSS na popover. |
boundary |
eriri, element | 'clippingParents' |
Oke mmachi oke oke nke popover (na-emetụta naanị Popper's preventOverflow modifier). Site na ndabara, ọ 'clippingParents' nwere ike nabata ntụaka HTMLElement (site na Javascript naanị). Maka ozi ndị ọzọ rụtụ aka na docs detectOverflow nke Popper . |
container |
eriri, mmewere, ụgha | false |
Na-agbakwunye popover na otu mmewere. Ọmụmaatụ container: 'body' :. Nhọrọ a bara uru karịsịa n'ihi na ọ na-enye gị ohere idobe popover na ntinye akwụkwọ ahụ n'akụkụ ihe na-akpali akpali - nke ga-egbochi popover ka ọ na-ese n'elu ihe na-akpali akpali n'oge ntụgharị windo. |
content |
eriri, mmewere, ọrụ | '' |
Uru ọdịnaya ezighi ezi ma ọ bụrụ data-bs-content na njirimara adịghị. Ọ bụrụ na enyere ọrụ, a ga-akpọ ya na this nrụtụ aka ya nke etinyere na popover. |
customClass |
eriri, ọrụ | '' |
Tinye klaasị na popover mgbe egosiri ya. Rịba ama na a ga-agbakwunye klaasị ndị a na mgbakwunye na klaasị ọ bụla akọwapụtara na ndebiri. Ka ịgbakwunye ọtụtụ klaasị, kewaa ha na oghere: 'class-1 class-2' . Ị nwekwara ike ịgafe ọrụ kwesịrị iweghachi otu eriri nwere aha klaasị agbakwunyere. |
delay |
nọmba, ihe | 0 |
Igosipụta na izobe popover (ms) - anaghị emetụta ụdị mkpalite aka. Ọ bụrụ na ewepụtara nọmba, a na-etinye igbu oge na ma zoo/egosi. Nhazi ihe bụ: delay: { "show": 500, "hide": 100 } . |
fallbackPlacements |
eriri, n'usoro | ['top', 'right', 'bottom', 'left'] |
Kọwaa ebe ndaghachi azụ site n'inye ndepụta ntinye n'usoro (n'usoro masịrị gị). Maka ozi ndị ọzọ rụtụ aka na akwụkwọ omume Popper . |
html |
boolean | false |
Hapụ HTML na popover. Ọ bụrụ na ọ bụ eziokwu, mkpado HTML dị na popover ka title a ga-atụgharị na popover. Ọ bụrụ ụgha, innerText a ga-eji ihe onwunwe tinye ọdịnaya n'ime DOM. Jiri ederede ma ọ bụrụ na ị na-echegbu onwe gị maka mwakpo XSS. |
offset |
nọmba, eriri, ọrụ | [0, 0] |
Mwepu nke popover n'ihe metụtara ebumnuche ya. Ị nwere ike ịnyefe eriri n'ime njirimara data site na iji ụkpụrụ kewapụrụ rikoma dị ka: data-bs-offset="10,20" . Mgbe a na-eji ọrụ chọpụta nkwụghachi ụgwọ, a na-akpọ ya na ihe nwere ntinye popper, akwụkwọ ntụaka, na popper rects dị ka arụmụka mbụ ya. A na-agafe oghere DOM na-akpalite dị ka arụmụka nke abụọ. Ọrụ ahụ ga-eweghachite usoro nwere ọnụọgụ abụọ: skidding , anya . Maka ozi ndị ọzọ rụtụ aka na docs offset Popper . |
placement |
eriri, ọrụ | 'top' |
Otu esi edobe popover: akpaaka, elu, ala, aka ekpe, aka nri. Mgbe auto akọwapụtara ya, ọ ga-emegharịgharị popover nke ukwuu. Mgbe a na-eji ọrụ iji chọpụta ntinye, a na-akpọ ya na popover DOM node dị ka arụmụka mbụ ya na ihe na-akpali akpali DOM node dị ka nke abụọ ya. Edebere this ihe gbara ya gburugburu ka ọ bụrụ ihe atụ popover. |
popperConfig |
efu, ihe, ọrụ | null |
Ka ịgbanwee ndabara Bootstrap Popper config, hụ nhazi nke Popper . Mgbe a na-eji ọrụ mepụta nhazi Popper, a na-akpọ ya na ihe nwere nhazi ndabara nke Bootstrap. Ọ na-enyere gị aka iji ma jikọta ndabara na nhazi nke gị. Ọrụ ahụ ga-eweghachite ihe nhazi maka Popper. |
sanitize |
boolean | true |
Kwado ma ọ bụ gbanyụọ nhichapụ ahụ. Ọ bụrụ na agbanyere ya 'template' , 'content' a 'title' ga-ehichapụkwa nhọrọ. |
sanitizeFn |
efu, ọrụ | null |
N'ebe a, ị nwere ike ịnye ọrụ ịdị ọcha nke gị. Nke a nwere ike ịba uru ma ọ bụrụ na-amasị gị iji ọbá akwụkwọ raara onwe ya nye iji rụpụta ịdị ọcha. |
selector |
eriri, ụgha | false |
Ọ bụrụ na enyere onye nhọpụta, a ga-ekenyefe ihe popover na ebumnuche ndị akọwapụtara. Na omume, a na-eji nke a tinyekwa popovers na ihe mgbakwunye DOM ( jQuery.on nkwado). Hụ mbipụta a na ihe atụ na-enye nkọwa . |
template |
eriri | '<div class="popover" role="popover"><div class="popover-arrow"></div><div class="popover-inner"></div></div>' |
Ntọala HTML iji mee ihe mgbe ị na-emepụta popover. A title ga-agbaba popover n'ime .popover-inner . .popover-arrow ga-abụ akụ popover. Ihe mkpuchi ihe kachasị elu kwesịrị inwe .popover klaasị na role="popover" . |
title |
eriri, mmewere, ọrụ | '' |
Uru aha ndabara ma ọ bụrụ title na njirimara adịghị. Ọ bụrụ na enyere ọrụ, a ga-akpọ ya na this nrụtụ aka ya nke etinyere na popover. |
trigger |
eriri | 'hover focus' |
Otu esi akpalite popover: pịa, hover, lekwasịrị anya, akwụkwọ ntuziaka. Ị nwere ike ịgafe ọtụtụ ihe mkpali; kewaa ha na oghere. 'manual' na-egosi na popover ga-akpalite mmemme site na .popover('show') , .popover('hide') na .popover('toggle') usoro; enweghị ike ijikọ ọnụ ahịa a na mkpalite ọ bụla ọzọ. 'hover' n'onwe ya ga-ebute popovers na-enweghị ike ịkpalite site na ahụigodo, ma ekwesịrị iji ya ma ọ bụrụ na ụzọ ọzọ maka ibufe otu ozi maka ndị ọrụ ahụigodo dị. |
Njirimara data maka popovers n'otu n'otu
Enwere ike ịkọwa nhọrọ maka popovers n'otu n'otu site na iji njirimara data, dịka akọwara n'elu.
Iji ọrụ napopperConfig
const popover = new bootstrap.Popover(element, {
popperConfig(defaultBsPopperConfig) {
// const newPopperConfig = {...}
// use defaultBsPopperConfig if needed...
// return newPopperConfig
}
})
Ụzọ
Ụzọ asynchronous na ntụgharị
Ụzọ API niile enweghị atụ wee malite mgbanwe . Ha na-alaghachikwuru onye na-akpọ oku ozugbo mgbanwe ahụ malitere mana tupu ya akwụsị . Na mgbakwunye, a ga-eleghara oku usoro na mpaghara mgbanwe anya .
Usoro | Nkọwa |
---|---|
disable |
Na-ewepụ ikike igosi popover element. A ga-enwe ike igosi popover naanị ma ọ bụrụ na agbanyere ya ọzọ. |
dispose |
Na-ezo ma na-emebi popover nke mmewere (na-ewepụ data echekwara na mmewere DOM). Popovers na-eji nnọchiteanya (nke a na-emepụta site na iji selector nhọrọ ) enweghị ike ibibi n'otu n'otu na ihe na-akpali akpali. |
enable |
Na-enye popover nke mmewere ikike igosi ya. Agbanyere popovers site na ndabara. |
getInstance |
Usoro static nke na-enye gị ohere ịnweta ihe atụ popover jikọtara ya na ihe DOM. |
getOrCreateInstance |
Usoro static nke na-enye gị ohere ịnweta ihe atụ popover jikọtara ya na mmewere DOM, ma ọ bụ mepụta nke ọhụrụ ma ọ bụrụ na ebidoghị ya. |
hide |
Na-ezobe popover nke mmewere. Na-alaghachikwute onye na-akpọ oku tupu ezobe popover (ya bụ tupu hidden.bs.popover mmemme emee). A na-ewere nke a dị ka "akwụkwọ ntuziaka" na-ebute popover. |
setContent |
Na-enye ụzọ ịgbanwe ọdịnaya popover ka mmalite ya gasịrị. |
show |
Na-ekpughe popover nke mmewere. Na-alaghachikwute onye na-akpọ oku tupu egosiri popover (ya bụ, tupu shown.bs.popover mmemme emee). A na-ewere nke a dị ka "akwụkwọ ntuziaka" na-ebute popover. Popovers nke aha na ọdịnaya ha bụ efu-ogologo anaghị egosipụta. |
toggle |
Na-atụgharị popover nke mmewere. Na-alaghachikwute onye na-akpọ oku tupu egosiri ma ọ bụ zoo popover (ya bụ tupu ihe omume shown.bs.popover ma ọ bụ hidden.bs.popover ihe emee). A na-ewere nke a dị ka "akwụkwọ ntuziaka" na-ebute popover. |
toggleEnabled |
Na-atụgharị ikike igosi ma ọ bụ zobe ihe popover nke ihe. |
update |
Na-emelite ọnọdụ popover element. |
// getOrCreateInstance example
const popover = bootstrap.Popover.getOrCreateInstance('#example') // Returns a Bootstrap popover instance
// setContent example
myPopover.setContent({
'.popover-header': 'another title',
'.popover-body': 'another content'
})
setContent
ahụ na-anabata
object
arụmụka, ebe igodo ihe onwunwe ọ bụla bụ ezigbo
string
nhọrọ n'ime ndebiri popover, yana uru ọ bụla metụtara ya nwere ike ịbụ
string
|
element
|
function
|
null
Ihe omume
Ihe omume | Nkọwa |
---|---|
hide.bs.popover |
A na-agbapụ ihe omume a ozugbo hide a kpọrọ usoro ihe atụ. |
hidden.bs.popover |
A na-agbapụ ihe omume a mgbe ezoro ezoro onye ọrụ ahụ popover (ga-echere mgbanwe CSS ka agwụchaa). |
inserted.bs.popover |
Emere mmemme a ka emechara ihe show.bs.popover omume mgbe agbakwunyere ndebiri popover na DOM. |
show.bs.popover |
Ihe omume a na-agba ọkụ ozugbo show a na-akpọ usoro ihe atụ. |
shown.bs.popover |
A na-agbapụ ihe omume a mgbe onye ọrụ mere ka popover ahụ hụ ya (ga-echere mgbanwe CSS ka agwụchaa). |
const myPopoverTrigger = document.getElementById('myPopover')
myPopoverTrigger.addEventListener('hidden.bs.popover', () => {
// do something...
})