Skip to di men tin dɛn we de insay Skip to doks nevigishɔn
Check
in English

Popovers dɛn

Dokumɛnt ɛn ɛgzampul fɔ ad Bootstrap popovers, lɛk di wan dɛn we de na iOS, to ɛni ɛlimɛnt na yu sayt.

Ɔvaviu fɔ di Baybul

Tin dɛn fɔ no we yu de yuz di popover plɔgin:

  • Popovers de abop pan di tɔd pati laybri Popper fɔ pozishɔn. Yu fɔ put popper.min.js bifo bootstrap.js, ɔ yuz wan bootstrap.bundle.min.jswe gɛt Popper.
  • Popovers nid di popover plɔgin as dipɛnsin.
  • Popovers na opt-in fɔ pefɔmɛns rizin, so yu fɔ initialize dɛn yusɛf .
  • Ziro-lɛngth titleɛn contentvalyu dɛn nɔ go ɛva sho wan popover.
  • Spɛsify container: 'body'fɔ avɔyd fɔ rɛnd prɔblɛm dɛn na mɔ kɔmpleks kɔmpɔnɛnt dɛn (lɛk wi input grup dɛn, bɔtin grup dɛn, ɛn ɔda wan dɛn).
  • Trigεr popovers pan hidden elements nɔ go wok.
  • Popovers fɔ .disabledɔ disabledɛlimɛnt dɛn fɔ trig pan wan wrap ɛlimɛnt.
  • We dɛn trig am frɔm anka dɛn we de rap akɔdin to bɔku layn dɛn, di popover dɛn go de sɛnt bitwin di ankɔ dɛn ɔl di wit. Yuz .text-nowrappan yu <a>s fɔ avɔyd dis bihayvya.
  • Popovers fɔ ayd bifo dɛn dɔn pul dɛn kɔrɛspɔndɛns ɛlimɛnt dɛn na di DOM.
  • Popovers kin trigεr tanks to wan εlimεnt insay wan shado DOM.
Bay difɔlt, dis kɔmpɔnɛnt de yuz di kɔntinyu sanitiza we dɛn bil insay, we de pul ɛni HTML ɛlimɛnt dɛn we dɛn nɔ alaw klia wan. Si di say we se sanitiza na wi JavaSkript dɔkyumentri fɔ no mɔ.
Di animashɔn ifɛkt fɔ dis kɔmpɔnɛnt de dipen pan di prefers-reduced-motionmidia kwɛstyɔn. Si di ridyus muvmɛnt sɛkshɔn na wi aksesibiliti dɔkyumentri .

Kɔntinyu fɔ rid fɔ si aw popovers de wok wit sɔm ɛgzampul dɛn.

Ɛgzampul dɛn

Enable di popovers fɔ di wan dɛn we de wok

As wi bin dɔn tɔk, yu fɔ initialize popovers bifo dɛn kin yuz dɛn. Wan we fɔ initialize ɔl di popovers na wan pej go bi fɔ pik dɛn bay dɛn data-bs-toggleatribyut, lɛk so:

const popoverTriggerList = document.querySelectorAll('[data-bs-toggle="popover"]')
const popoverList = [...popoverTriggerList].map(popoverTriggerEl => new bootstrap.Popover(popoverTriggerEl))

Layf dɛmo

Wi de yuz JavaSkript we fiba di snipet we de ɔp fɔ rɛnd di layv popover we de dɔŋ ya. Taytul dɛn de sɛt via data-bs-titleɛn bɔdi kɔntinyu de sɛt via data-bs-content.

Fil fri fɔ yuz ɛni wan pan dɛn titleɔ data-bs-titleinsay yu HTML. We titledɛn yuz am, Popper go riples am ɔtomɛtik wan data-bs-titlewe dɛn rɛnd di ɛlimɛnt.
html
<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>

Fo dairekshɔn dɛn

Fo opshɔn dɛn de: ɔp, rayt, dɔŋ, ɛn lɛft. Dairekshɔn dɛn de mirɔ we yu de yuz Bootstrap na RTL. Set data-bs-placementfɔ chenj di dairekshɔn.

html
<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>

Wetin kɔmɔncontainer

We yu gɛt sɔm stayl dɛn pan wan mama ɛn papa ɛlimɛnt we de ambɔg wan popover, yu go want fɔ spɛsifa wan kɔstɔm containerso dat di popover in HTML go apia insay da ɛlimɛnt de insted. Dis kin apin na tebul dɛn we de ansa, input grup dɛn, ɛn ɔda tin dɛn lɛk dat.

const popover = new bootstrap.Popover('.example-popover', {
  container: 'body'
})

Wan ɔda sityueshɔn usay yu go want fɔ sɛt wan ɛksplisit kɔstɔm containerna popovers insay wan modal dayalɔg , fɔ mek shɔ se di popover sɛf de apɛnd to di modal. Dis impɔtant mɔ fɔ popover dɛn we gɛt intaraktiv ɛlimɛnt dɛn – modal dayalɔg dɛn go trap fɔs, so pas di popover na pikin ɛlimɛnt na di modal, di wan dɛn we de yuz am nɔ go ebul fɔ fos ɔ aktiv dɛn intaraktiv ɛlimɛnt dɛn ya.

const popover = new bootstrap.Popover('.example-popover', {
  container: '.modal-body'
})

Kastom popovers dɛn

Dɛn ad am na v5.2.0

Yu kin kɔstɔmayz di apinɛns fɔ popover dɛn yuz CSS vɛriɔbul dɛn . Wi sɛt wan kɔstɔm klas wit data-bs-custom-class="custom-popover"fɔ skɔp wi kɔstɔm apinɛns ɛn yuz am fɔ ɔvalayz sɔm pan di lokal CSS vɛriɔbul dɛn.

.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;
}
html
<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>

Dismis na di nɛks klik

Yuz di focustriga fɔ dismis popovers pan di yuza in nɛks klik fɔ wan difrɛn ɛlimɛnt pas di tɔgl ɛlimɛnt.

Speshal mak we nid fɔ dismis-ɔn-nɛks-klik

Fɔ mek yu krɔs-brawza ɛn krɔs-pletfɔm biev fayn, yu fɔ yuz di <a>tɛg, nɔto di <button>tɛg, ɛn yu fɔ put wan tabindexatribyut bak.

html
<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'
})

Di ɛlimɛnt dɛn we nɔ ebul fɔ wok

Elemɛnt dɛn wit di disabledatribyut nɔ de intaraktiv, we min se yuzman dɛn nɔ kin ebul fɔ hover ɔ klik dɛn fɔ trig wan popover (ɔ tultip). As wokarawnd, yu go want fɔ trig di popover frɔm wan wrap <div>ɔ <span>, ideally mek keyboard-focusable yuz tabindex="0".

Fɔ disabled popover triggers, yu kin lɛk bak data-bs-trigger="hover focus"so dat di popover go apia as kwik vijual fidbak to yu yuza dɛn as dɛn nɔ go ɛkspɛkt fɔ klik pan wan disabled element.

html
<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 we dɛn kɔl CSS

Di tin dɛn we kin chenj

Dɛn ad am na v5.2.0

As pat pan Bootstrap in evolvin CSS vɛriɔbul dɛn aprɔch, popovers naw de yuz lokal CSS vɛriɔbul dɛn on .popoverfɔ ɛnhans rial-taym kɔstɔmayshɔn. Valyu fɔ di CSS vɛriɔbul dɛn de sɛt via Sass, so Sass kɔstɔmayshɔn stil de sɔpɔt, bak.

  --#{$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 di vayriɔbul dɛn

$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;

Aw fɔ yuz am

Enable popovers bay JavaSkript:

const exampleEl = document.getElementById('example')
const popover = new bootstrap.Popover(exampleEl, options)

Mek popovers wok fɔ kibɔd ɛn ɛp tɛknɔlɔji yuza dɛn

Fɔ alaw kibɔd yuza dɛn fɔ aktiv yu popovers, yu fɔ jɔs ad dɛn to HTML ɛlimɛnt dɛn we tradishɔnal kibɔd-fɔkus ɛn intaraktiv (lɛk link ɔ fɔm kɔntrol). Pan ɔl we dɛn kin mek arbitri HTML ɛlimɛnt dɛn (lɛk <span>s) fɔs bay we dɛn ad di tabindex="0"atribyut, dis go ad tab stɔp dɛn we kin anɔynt ɛn kɔnfyus pan tin dɛn we nɔ de intaraktiv fɔ di wan dɛn we de yuz di kibɔd, ɛn bɔku pan di ɛtɛknɔlɔji dɛn we de ɛp pipul dɛn naw nɔ de anɔys di tin dɛn we de insay di popover insay dis sityueshɔn . Apat frɔm dat, nɔ jɔs abop pan hoveras di trig fɔ yu popovers, bikɔs dis go mek dɛn nɔ pɔsibul fɔ trig fɔ di wan dɛn we de yuz kibɔd.

Pan ɔl we yu kin put rich, strɔkchɔ HTML insay popovers wit di htmlopshɔn, wi rili advays yu fɔ avɔyd fɔ ad bɔku bɔku tin dɛn. Di we aw popover dɛn de wok naw na dat, wans dɛn dɔn sho dɛn, dɛn kɔntinyu fɔ tay to di trig ɛlimɛnt wit di aria-describedbyatribyut. As a rizulyt, di ɔltin fɔ di popover in kɔntinyu go anɔys to ɛp tɛknɔlɔji yuza dɛm as wan lɔng, nɔ-interrupted strim.

Apat frɔm dat, pan ɔl we i pɔsibul fɔ put intaraktiv kɔntrol dɛn bak (lɛk fɔm ɛlimɛnt ɔ link dɛn) na yu popover (bay we yu ad dɛn ɛlimɛnt dɛn ya to di allowListɔf atribyut ɛn tag dɛn we dɛn alaw), mɛmba se naw di popover nɔ de manej kibɔd fɔs ɔda. We pɔsin we de yuz kibɔd opin popover, fɔs de kɔntinyu fɔ de pan di trig ɛlimɛnt, ɛn as di popover nɔ kin fala di trig wantɛm wantɛm na di dɔkyumɛnt in strɔkchɔ, no garanti nɔ de fɔ se fɔ go bifo/presTABgo muv wan kibɔd yuza insay di popover sɛf. In shot, jɔs ad intaraktiv kɔntrol to wan popover go mɔs mek dɛn kɔntrol ya nɔ rich/nɔ yuz fɔ di wan dɛn we de yuz kibɔd ɛn di wan dɛn we de yuz ɛp tɛknɔlɔji dɛn, ɔ at di ɔl fɔ mek wan ɔvala fɔs ɔda we nɔ mek lɔjik. Insay dɛn kayn tin ya, tink bɔt fɔ yuz wan modal dayalɔg insted.

Di tin dɛn we yu kin pik fɔ du

As opshɔn dɛn kin pas bay data atribyut ɔ JavaSkript, yu kin ad opshɔn nem to data-bs-, lɛk insay data-bs-animation="{value}". Mek shɔ se yu chenj di kes tayp fɔ di opshɔn nem frɔm “ camelCase ” to “ kebab-case ” we yu de pas di opshɔn dɛn tru data atribyut dɛn. Fɔ ɛgzampul, yuz data-bs-custom-class="beautifier"insted fɔ data-bs-customClass="beautifier".

As fɔ Bootstrap 5.2.0, ɔl di kɔmpɔnɛnt dɛn de sɔpɔt wan ɛkspirimɛnt rizɔv data atribyut data-bs-configwe kin os simpul kɔmpɔnɛnt kɔnfigyushɔn as JSON string. We wan ɛlimɛnt gɛt data-bs-config='{"delay":0, "title":123}'ɛn data-bs-title="456"atribyut, di fayn titlevalyu go bi 456ɛn di sɛpret data atribyut dɛn go ɔvalayz valyu dɛn we dɛn gi pan data-bs-config. Apat frɔm dat, di data atribyut dɛn we de naw ebul fɔ gɛt JSON valyu dɛn lɛk data-bs-delay='{"show":0,"hide":150}'.

Notis se fɔ sikyɔriti rizin dɛn nɔ go ebul fɔ gi di sanitize, sanitizeFn, ɛn allowListopshɔn dɛn we yu de yuz di data atribyut dɛn.
Nem Kayn Balans Tɔk bɔt
allowList tin Difɔlt valyu Objek we gɛt atribyut ɛn tag dɛn we dɛn alaw.
animation boolean we dɛn kɔl true Aplay wan CSS fade transishɔn to di popover.
boundary string, ɛlimɛnt 'clippingParents' Ovaflɔ kɔnstrakshɔn bɔda fɔ di popover (i de aplay nɔmɔ to Popper in preventOverflow modifya). Bay difɔlt, i de 'clippingParents'ɛn kin aksept wan HTMLElement rɛfrɛns (via JavaSkript nɔmɔ). Fɔ no mɔ, luk na Popper’s detectOverflow docs .
container string, ɛlimɛnt, lay lay tin dɛn false Apɛnd di popover to wan patikyula ɛlimɛnt. Fɔ ɛgzampul: container: 'body'. Dis opshɔn rili yusful bikɔs i de alaw yu fɔ posishun di popover insay di flɔ na di dɔkyumɛnt nia di trig ɛlimɛnt - we go mek di popover nɔ flot away frɔm di trig ɛlimɛnt we yu de risayz di winda.
content string, ɛlimɛnt, fɛnshɔn '' Difɔlt kɔntinyu valyu if data-bs-contentatribyut nɔ de. If dɛn gi wan fɛnshɔn, dɛn go kɔl am wit in thisrɛfrɛns sɛt to di ɛlimɛnt we di popover ataya to.
customClass string, fɔ wok '' Ad klas dɛn to di popover we dɛn sho am. Notis se dɛn go ad dɛn klas ya apat frɔm ɛni klas we dɛn dɔn sho na di tɛmplat. Fɔ ad bɔku klas dɛn, separet dɛn wit spɛshal say dɛn: 'class-1 class-2'. Yu kin pas wan fɛnshɔn bak we fɔ ritɔn wan string we gɛt ɔda klas nem dɛn.
delay nɔmba, sɔntin 0 Dilay fɔ sho ɛn ayd di popover (ms)—nɔ de aplay to manual trigger type. If dɛn gi wan nɔmba, dɛn kin delay fɔ ɔl tu di ayd/sho. Di we aw dɛn mek di tin dɛn na: delay: { "show": 500, "hide": 100 }.
fallbackPlacements string, arenjmɛnt ['top', 'right', 'bottom', 'left'] Difayn fɔlbak plesmɛnt dɛn bay we yu gi wan list fɔ plesmɛnt dɛn na arenjmɛnt (in ɔda we aw dɛn lɛk). Fɔ no mɔ, luk na Popper’s behavior docs .
html boolean we dɛn kɔl false Alaw HTML insay di popover. If na tru, HTML tag dɛn na di popover’s titlego rɛnd insay di popover. If na lay, innerTextdɛn go yuz prɔpati fɔ put kɔntinyu insay di DOM. Yuz tɛks if yu de wɔri bɔt XSS atak dɛn.
offset nɔmba, string, fɛnshɔn [0, 0] Offset of di popover rilitiv to in target. Yu kin pas wan string insay data atribyut dɛn wit kɔma separet valyu dɛn lɛk: data-bs-offset="10,20". We dɛn yuz wan fɛnshɔn fɔ no di ɔfset, dɛn kin kɔl am wit wan ɔbjɛkt we gɛt di pɔpa plesmɛnt, di rɛfrɛns, ɛn di pɔpa rɛkt dɛn as in fɔs argumɛnt. Di trigεrin εlimεnt DOM node de pas as di sɛkɔn argumɛnt. Di fɛnshɔn fɔ ritɔn wan arenjmɛnt wit tu nɔmba dɛn: skidding , distans . Fɔ no mɔ, luk na Popper’s offset docs .
placement string, fɔ wok 'top' Aw fɔ posishun di popover: ɔto, ɔp, dɔŋ, lɛft, rayt. We autodɛn spɛsifa, i go dinamik rioriɛnt di popover. We dɛn yuz wan fɛnshɔn fɔ no di plesmɛnt, dɛn kin kɔl am wit di popover DOM node as in fɔs argumɛnt ɛn di trigɛn ɛlimɛnt DOM node as in sɛkɔn. Di thiskɔntɛks de sɛt to di popover instans.
popperConfig nul, ɔbjɛkt, fɛnshɔn null Fɔ chenj Bootstrap in difɔlt Popper kɔnfigyushɔn, si Popper in kɔnfigyushɔn . We dɛn yuz wan fɛnshɔn fɔ mek di Popper kɔnfigyushɔn, dɛn kin kɔl am wit wan ɔbjɛkt we gɛt di Bootstrap in difɔlt Popper kɔnfigyushɔn. I de ɛp yu fɔ yuz ɛn jɔyn di difɔlt wit yu yon kɔnfigyushɔn. Di fɛnshɔn fɔ ritɔn wan kɔnfigyushɔn ɔbjɛkt fɔ Popa.
sanitize boolean we dɛn kɔl true Enable ɔ disable di sanitayzeshɔn. If activated 'template', 'content'ɛn 'title'opshɔn dɛn go sanitayz.
sanitizeFn nul, fɔ wok null Na ya yu kin saplae yu own sanitize function. Dis kin fayn if yu lɛk fɔ yuz laybri we dɛn dɔn gi yu fɔ du sanitayzeshɔn.
selector string, lay lay tɔk false If dɛn gi wan sɛlɛktɔ, dɛn go deleget popover ɔbjɛkt dɛn to di target dɛn we dɛn dɔn spɛsifa. In prɔsis, dɛn kin yuz dis fɔ aplay bak popovers to dinamik ad DOM ɛlimɛnt dɛn ( jQuery.onsɔpɔt). Si dis magazin ɛn wan ɛgzampul we gɛt bɔku tin dɛn fɔ no bɔt .
template rop '<div class="popover" role="popover"><div class="popover-arrow"></div><div class="popover-inner"></div></div>' Base HTML fɔ yuz we yu de mek di popover. Di popover's titlego injekt insay di .popover-inner. .popover-arrowgo bi di popover in aro. Di ɔtamost wrap ɛlimɛnt fɔ gɛt di .popoverklas ɛn role="popover".
title string, ɛlimɛnt, fɛnshɔn '' Difɔlt taytul valyu if titleatribyut nɔ de. If dɛn gi wan fɛnshɔn, dɛn go kɔl am wit in thisrɛfrɛns sɛt to di ɛlimɛnt we di popover ataya to.
trigger rop 'hover focus' Aw popover de trig: klik, hova, fos, manual. Yu kin pas bɔku trig dɛn; separet dɛn wit wan ples. 'manual'indiket se di popover go trigεr programmatically via di .popover('show'), .popover('hide')εn .popover('toggle')mεtכd dεm; dis valyu nɔ kin kam togɛda wit ɛni ɔda trig. 'hover'pan insɛf go rili mek popovers we dɛn nɔ go ebul fɔ trig tru di kibɔd, ɛn dɛn fɔ jɔs yuz am if ɔda we fɔ gi di sem infɔmeshɔn fɔ di wan dɛn we de yuz di kibɔd de.

Data atribyut fɔ wan wan popover dɛn

Opshɔn fɔ wan wan popover dɛn kin ɔda we fɔ spɛsifa tru di yus fɔ data atribyut dɛn, as dɛn ɛksplen am ɔp.

Yuz funkshɔn witpopperConfig

const popover = new bootstrap.Popover(element, {
  popperConfig(defaultBsPopperConfig) {
    // const newPopperConfig = {...}
    // use defaultBsPopperConfig if needed...
    // return newPopperConfig
  }
})

Di we aw dɛn de du am

Asynchronous mεtכd dεm εn transishכn dεm

Ɔl di API mɛtɔd dɛn na asynchronous ɛn dɛn kin stat wan transishɔn . Dɛn kin go bak to di pɔsin we kɔl am jɔs lɛk aw dɛn bigin fɔ chenj bɔt bifo i dɔn . Apat frɔm dat, dɛn go ignore wan mɛtɔd kɔl pan wan transishɔn kɔmpɔnɛnt .

Si wi JavaSkript dɔkyumentri fɔ no mɔ .

We Tɔk bɔt
disable Rimov di abiliti fɔ wan ɛlimɛnt in popover fɔ sho. Di popover go onli ebul fɔ sho if dɛn ri-enable am.
dispose Ayd ɛn pwɛl wan ɛlimɛnt in popover (Rimov di data we dɛn dɔn kip na di DOM ɛlimɛnt). Popovers we de yuz delegɛshɔn (we dɛn mek yuz di selectoropshɔn ) nɔ kin ebul fɔ pwɛl wan wan pan disɛndant trig ɛlimɛnt dɛn.
enable Gi wan element in popover di abiliti fɔ sho. Popovers dɛn dɔn ɛnabul bay difɔlt.
getInstance Statik we de alaw yu fɔ gɛt di popover instans we gɛt fɔ du wit wan DOM ɛlimɛnt.
getOrCreateInstance Statik we de alaw yu fɔ gɛt di popover instans we gɛt fɔ du wit wan DOM ɛlimɛnt, ɔ mek wan nyu wan insay kes we i nɔ bin initialize.
hide Ayd wan ɛlimɛnt in popover. Ritɔn to di pɔsin we kɔl bifo di popover dɔn rili ayd (dat na bifo di hidden.bs.popoverivin apin). Dɛn kin tek dis as “manual” we de trig di popover.
setContent Gi wan we fɔ chenj di popover in kɔntinyu afta i initialize.
show Rivɛl wan ɛlimɛnt in popover. Ritɔn to di pɔsin we kɔl bifo di popover dɔn rili sho (dat na bifo di shown.bs.popoverivin apin). Dɛn kin tek dis as “manual” we de trig di popover. Popovers we dɛn taytul ɛn kɔntinyu ɔl tu na ziro-lɛngth nɔ de ɛva sho.
toggle Toggles wan element in popover. Ritɔn to di pɔsin we kɔl bifo di popover dɔn rili sho ɔ ayd (dat na bifo di shown.bs.popoverɔ hidden.bs.popoverivin apin). Dɛn kin tek dis as “manual” we de trig di popover.
toggleEnabled Toggles di abiliti fɔ wan element in popover fɔ sho ɔ ayd.
update Updates di posishun fɔ wan ɛlimɛnt in popover.
// 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'
})
Di setContentwe aw dɛn de du am de aksept wan objectargumɛnt, usay ɛni prɔpati-ki na valid stringsɛlɛktɔ insay di popover tɛmplat, ɛn ɛni prɔpati-valyu we gɛt fɔ du wit am kin bi string| element| function| null

Di tin dɛn we kin apin

Program Tɔk bɔt
hide.bs.popover Dis ivent de faya wantɛm wantɛm we hidedɛn dɔn kɔl di instans mɛtɔd.
hidden.bs.popover Dis ivent de faya we di popover dɔn dɔn fɔ ayd frɔm di yuza (go wet fɔ CSS transishɔn dɛn fɔ dɔn).
inserted.bs.popover Dis ivent de faya afta di show.bs.popoverivent we dɛn dɔn ad di popover tɛmplat to di DOM.
show.bs.popover Dis ivent de faya wantɛm wantɛm we dɛn kɔl di showinstans mɛtɔd.
shown.bs.popover Dis ivent de faya we di popover dɔn mek visible to di yuza (go wet fɔ CSS transishɔn fɔ dɔn).
const myPopoverTrigger = document.getElementById('myPopover')
myPopoverTrigger.addEventListener('hidden.bs.popover', () => {
  // do something...
})