Tɛmɛn ka taa kunnafoni kunbabaw la Tɛmɛn ka taa docs navigation kan
Check
in English

Popovers (Popovers) ye

Sɛbɛnw ni misaliw walasa ka Bootstrap popovers fara ɲɔgɔn kan, i n’a fɔ minnu bɛ sɔrɔ iOS kɔnɔ, fɛn o fɛn na i ka siti kan.

Kuma bɛɛ lajɛlen

Fɛn minnu ka kan ka dɔn ni i bɛ baara kɛ ni popover plugin ye:

  • Popovers bɛ u jigi da mɔgɔ sabanan ka gafemarayɔrɔ Popper kan jɔyɔrɔko la. Aw ka kan ka popper.min.js don ka kɔn bootstrap.js, walima ka baara kɛ ni dɔ ye bootstrap.bundle.min.jsmin kɔnɔ Popper bɛ yen.
  • Popovers bɛ popover plugin de wajibiya i n’a fɔ dependency.
  • Popovers ye opt-in ye baarakɛcogo kunw na, o la aw yɛrɛ ka kan k’u daminɛ .
  • Zero-janya titleni contentnafaw tɛna popover jira abada.
  • A jira container: 'body'walasa ka i yɛrɛ tanga ɲɛfɔli gɛlɛyaw ma yɔrɔw la minnu ka gɛlɛn kosɛbɛ (i n’a fɔ an ka donnakow kuluw, butɔni kuluw, a ɲɔgɔnnaw).
  • Popovers (popovers) daminɛni fɛn dogolenw kan, o tɛna baara kɛ.
  • Popovers for .disabledwalima disabledelements ka kan ka daminɛ wrapper element kan.
  • Ni a bɛ daminɛ ka bɔ jɛgɛw la minnu bɛ siri tigɛli caman na, popovers bɛna kɛ cɛmancɛ la jɛgɛw bɛɛ bonya bɛɛ cɛ. Aw .text-nowrapbɛ baara kɛ ni aw ka <a>s ye walasa ka aw yɛrɛ tanga nin kɛcogo in ma.
  • Popovers ka kan ka dogo sani u bɛnkanw ka bɔ DOM kɔnɔ.
  • Popovers bɛ se ka daminɛ k’a sababu kɛ fɛn dɔ ye min bɛ DOM biɲɛ dɔ kɔnɔ.
A daminɛ na, nin yɔrɔ in bɛ baara Kɛ ni kɔnɔkow saniyalan ye min bɛ Dòn a kɔnɔ, o min bɛ HTML fɛn o fɛn Bɔ min ma Sɔn k’a jɛya. Aw ye saniya yɔrɔ lajɛ an ka JavaScript sɛbɛnw kɔnɔ walasa ka kunnafoni wɛrɛw sɔrɔ.
Nin yɔrɔ in ka animation nɔ bɛ bɔ prefers-reduced-motionmedia ɲininkali de la. aw ye an ka sɔrɔli sɛbɛnw yɔrɔ lajɛ min bɛ lamaga dɔgɔyalen na .

Aw bɛ to ka kalan kɛ walasa ka a dɔn popoverw bɛ baara kɛ cogo min na ni misali dɔw ye.

Misaliw

A bɛ se ka popovers (popovers) kɛ

I n’a fɔ a fɔra cogo min na sanfɛ, aw ka kan ka popoverw daminɛ sani u ka se ka baara kɛ ni u ye. Popover bɛɛ daminɛcogo dɔ ɲɛ dɔ kan o ye k’u sugandi u ka data-bs-togglefɛnɲɛnɛma fɛ, i n’a fɔ nin cogo la:

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

Demo en direct

An bɛ baara Kɛ ni JavaScript ye min ni sanfɛla yɔrɔ in bɛ Taa ɲɔgɔn fɛ walasa ka nin popover ɲɛnama in jira. Titlew bɛ sigi via data-bs-titleani farikolo kɔnɔkow bɛ sigi via data-bs-content.

Aw kana siga ka baara kɛ ni u dɔ ye titlewalima data-bs-titleaw ka HTML kɔnɔ. Ni titlea bɛ baara kɛ, Popper bɛna a bila a nɔ na a yɛrɛma ni data-bs-titleelement in bɛ jira.
html ye
<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>

Sira naani

Sugandili naani bɛ yen: sanfɛ, kinin fɛ, duguma ani numan fɛ. Ladilikanw bɛ jira ni Bootstrap ye RTL kɔnɔ. A’ ye a sigi data-bs-placementwalasa ka sira caman Changer.

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

Laadacontainer

Ni i ye cogoya dɔw Sɔrɔ bangebaga-yɔrɔ dɔ kan minnu bɛ popover dɔ bali, i b’a fɛ ka ladamu dɔ Jira containerwalasa popover ka HTML ka Bɔ o element ‘kɔnɔ o nɔ na. O bɛ kɛ jaabi tabali la, donta kuluw ani o ɲɔgɔnnaw na.

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

Ko wɛrɛ min na i b'a fɛ ka laada jɛlen dɔ sigi sen kan o containerye popovers ye modal dialogue kɔnɔ , walasa ka a dɔn ko popover yɛrɛ bɛ fara modal kan. O nafa ka bon kɛrɛnkɛrɛnnenya la popoverw ma minnu kɔnɔ fɛnw bɛ ɲɔgɔn sɔrɔ – modal dialogues bɛna focus minɛ, o la fo ni popover ye modal denmisɛn yɔrɔ ye, baarakɛlaw tɛna se ka focus walima ka baara kɛ ni o interactive elements ye.

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

Laada popovers

A farala a kan v5.2.0 kɔnɔ

aw bɛ se ka popoverw cogoya ladilan ni CSS fɛn caman sɛgɛsɛgɛli ye . An bɛ ladamu-kalanso dɔ sigi sen kan ni data-bs-custom-class="custom-popover"walasa k’an ka ladamu cogoya scope ani ka baara kɛ n’a ye walasa ka sigida CSS fɛn caman sɛgɛsɛgɛli kɛ.

.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 ye
<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>

Dismiss kan nata digi

Baara kɛ ni focustrigger ye walasa ka popovers (popovers) bɔ kɛnɛ kan baarakɛla ka fɛn wɛrɛ digilen na min tɛ toggle element ye.

Markup kɛrɛnkɛrɛnnen wajibiyalen don dismiss-on-next-click kama

Walasa ka cross-browser ni cross-platform kɛcogo ɲuman sɔrɔ, i ka kan ka baara kɛ ni <a>tag ye, i kana baara kɛ ni <button>tag ye, wa i ka kan fana ka tabindexattribut dɔ don a kɔnɔ.

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

Eleman minnu bɛ se ka baara kɛ

Fɛn minnu bɛ ni fɛn ye disabled, olu tɛ ɲɔgɔndan ye, o kɔrɔ ye ko baarakɛlaw tɛ Se k’u jɔ walima k’u digi walasa ka popover (walima baarakɛminɛnw) dɔ Daminɛ. O cogo la, i b’a fɛ ka popover daminɛ ka bɔ wrapper <div>walima <span>, ideally made keyboard-focusable using tabindex="0".

Popover triggers disabled (popover triggers) la, i bɛ se fana k’a fɛ data-bs-trigger="hover focus"walasa popover ka jira i n’a fɔ teliya yecogo jaabi i ka baarakɛlaw ye i n’a fɔ u tɛ se ka a jira ko u bɛna fɛn dɔ digi disabled element kan.

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

Yɛlɛma-yɛlɛmaw

A farala a kan v5.2.0 kɔnɔ

Bootstrap ka CSS fɛn caman sɛgɛsɛgɛli fɛɛrɛ dɔ ye min bɛ ka wuli, popovers bɛ baara kɛ sisan ni sigida CSS fɛn caman sɛgɛsɛgɛli ye on .popoverfor for enhanced real-time customization. Nafa minnu bɛ CSS fɛn caman sɛgɛsɛgɛli la, olu bɛ sigi Sass fɛ, o la Sass ka ladamuni bɛ dɛmɛ hali bi, o fana.

  --#{$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 bεε bε bε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;

Baarakɛcogo

Popovers baara kɛ JavaScript fɛ:

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

Popoverw kɛli ka baara kɛ klaviyeti ni dɛmɛni fɛɛrɛw baarakɛlaw ye

Walasa ka sira Di klaviyeti baarakɛlaw ma u k’i ka popoverw baara, i ka kan k’u Fàra HTML yɔrɔw dɔrɔn kan minnu bɛ Se klaviyeti-yɔrɔ-ko laada la ani minnu bɛ Kɛ ɲɔgɔn fɛ (i n’a fɔ jὲɲɔgɔnya walima foroko-kɔlɔsili). Hali n’a y’a Sɔrɔ HTML fɛnɲɛnɛmaw (i n’a fɔ <span>s) bɛ Se ka Kɛ ‘fɛn ye min bɛ Se ka Kɛ ‘fɛn ye min bɛ Se ka Kɛ ‘fɛn ye min bɛ Se ka Kɛ ‘fɛn ye min bɛ Se ka Kɛ ‘fɛn ye min bɛ Se ka Kɛ ‘fɛn ye min bɛ Se ka ‘ tabindex="0"kɔnɔnafili ani k’u hakili ɲagami klaviyeti baarakɛlaw kan minnu tɛ ‘ɲɔgɔndɛmɛ ye, wa dɛmɛn-fɛɛrɛ fanba tɛ popover kɔnɔkow Laseli sisan nin ko in na . Ka fara o kan, i kana i jigi da dɔrɔn kan hoveri n’a fɔ i ka popovers (popovers) daminɛfɛn, bawo o bɛna a to u tɛ se ka daminɛ klaviyeti baarakɛlaw fɛ.

Hali n’i bɛ se ka HTML nafama, sigilen don popovers kɔnɔ ni htmlsugandi ye, an b’a ɲini i fɛ kosɛbɛ i k’i yɛrɛ tanga kunnafoni hakɛ tɛmɛnenw farali kan. Popoverw bɛ baara kɛ cogo min na sisan, o ye ko, n’u jirala dɔrɔn, u kɔnɔkow bɛ siri trigger element la ni aria-describedbyattribut ye. O de kosɔn, popover kɔnɔkow bɛɛ bɛna laseli dɛmɛn fɛɛrɛbɔlaw ma i n’a fɔ jikuru jan kelen min tɛ tigɛ.

Ka fara o kan, hali n’a bɛ se ka kɛ fana ka kunnafoni-falen-falen-minɛnw (i n’a fɔ formulaire elements walima links) don i ka popover kɔnɔ (ni i ye o fɛnw fara allowListof allowed attributes and tags kan), i k’a dɔn ko sisan popover tɛ keyboard focus order ɲɛnabɔ. Ni klaviyeti baarakɛla dɔ ye popover da wuli, sinsin bɛ to triggering element kan, wa i n’a fɔ a ka c’a la popover tɛ tugu trigger kɔ teliya la sɛbɛn in jɔcogo la, garanti si tɛ yen ko ka taa ɲɛfɛ/degunTABbɛna klaviyeti baarakɛla dɔ wuli ka don popover yɛrɛ kɔnɔ. Kuma surun na, n’i ye ɲɔgɔndan-minɛnw fara popover kan dɔrɔn, o bɛ se ka kɛ sababu ye ka nin kɔrɔsili ninnu kɛ fɛn ye min tɛ se ka sɔrɔ/min tɛ se ka baara kɛ ni klaviyeti baarakɛlaw ni dɛmɛ-fɛɛrɛw baarakɛlaw ye, walima a dɔgɔyalenba la, o bɛ kɛ sababu ye ka sinsincogo bɛɛ lajɛlen kɛ min tɛ hakili sɔrɔ. O cogo la, aw bɛ jateminɛ kɛ ka baara kɛ ni modal dialogue ye o nɔ na.

Sugandili minnu bɛ kɛ

I n’a fɔ sugandiliw bɛ se ka tɛmɛ data attributes walima JavaScript fɛ, i bɛ se ka sugandi tɔgɔ dɔ fara data-bs-, i n’a fɔ a bɛ cogo min na data-bs-animation="{value}". Aw ye aw jija ka sugandili tɔgɔ ka case suguya Changer ka bɔ “ camelCase ” la ka kɛ “ kebab-case ” ye ni aw bɛ sugandiliw tɛmɛ data attributes fɛ. Misali la, baara kɛ data-bs-custom-class="beautifier"ni data-bs-customClass="beautifier".

Kabini Bootstrap 5.2.0, yɔrɔw bɛɛ bɛ dɛmɛ don kunnafoni- falen-falen-yɔrɔ-ko -kɛcogodata-bs-config dɔ la min bɛ se ka yɔrɔw labɛncogo nɔgɔmanw bila i n’a fɔ JSON sɛrɛ. Ni fɛn dɔ bɛ data-bs-config='{"delay":0, "title":123}'ni ni data-bs-title="456"fɛnw ye, nafa laban titlebɛna kɛ 456ani kunnafoni danfaralenw bɛna nafaw wuli minnu dira data-bs-config. O tɛmɛnen 'kɔ, kunnafoni-falen-falen-minɛn minnu bɛ yen olu bɛ Se ka JSON nafaw Ladon i n'a fɔ data-bs-delay='{"show":0,"hide":150}'.

A kɔlɔsi ko lakana kunw kosɔn sanitize, sanitizeFn, ani allowListsugandiliw tɛ se ka di ni data attributes ye.
Tɔ̀gɔ Ka sɛbɛen masin na Fɔlɔ Cogojirali
allowList minɛn Nafa min bɛ sɔrɔ a daminɛ na Fɛn min bɛ ni fɛnw ni taamasiyɛnw ye minnu bɛ Sɔ̀rɔ.
animation boolean ye true CSS fade transition dɔ kɛ ka popover kɛ.
boundary juru, fɛn dɔ 'clippingParents' Popover ka overflow constraint dancɛ (a bɛ tali kɛ Popper ka preventOverflow modifier dɔrɔn de la). Ka da a kan, a bɛ 'clippingParents'ani a bɛ se ka sɔn HTMLElement ɲɛfɔli dɔ ma (JavaScript dɔrɔn fɛ). Walasa ka kunnafoni wɛrɛw sɔrɔ, aw ye Popper ka detectOverflow docs lajɛ .
container sɛrɛ, fɛn, nkalon false A bɛ popover fara fɛn kɛrɛnkɛrɛnnen dɔ kan. Misali la: container: 'body'. O sugandili in nafa ka bon kɛrɛnkɛrɛnnenya la bawo a b’a To i bɛ se ka popover (popover) Blà sɛbɛn in bolicogo la triggering element (daminɛ-yɔrɔ) kɛrɛfɛ - o bɛna popover bali ka pan ka Bɔ triggering (daminɛ-yɔrɔ) la finɛtiri bonya caman cili waati la.
content sɛrɛ, fɛn, baarakɛcogo '' Kɔnɔkow nafa dafalen ni data-bs-contentfɛnsɛbɛn tɛ yen. Ni baara dɔ dira, a bɛ Weele n'a ka this'reference set ye popover bɛ nɔrɔ min na.
customClass sɛrɛ, baarakɛcogo '' Aw bɛ kalanw fara popover kan ni a jirala. A kɔlɔsi ko o kalansenw bɛna fara kalansenw kan minnu kofɔlen don jatebɔsen kɔnɔ. Walasa ka kalansen caman fara ɲɔgɔn kan, aw bɛ u faranfasi ni yɔrɔw ye: 'class-1 class-2'. Aw bɛ se fana ka baarakɛcogo dɔ tɛmɛ min ka kan ka sɛrɛ kelen segin min kɔnɔ kalasi tɔgɔ wɛrɛw bɛ sɔrɔ.
delay jate, fɛn 0 Popover (ms) jirali ni a dogocogo latɛmɛni—o tɛ tali kɛ bololabaarakɛlaw ka trigger suguya la. Ni nimɔrɔ dɔ dira, delay bɛ kɛ hide/show fila bɛɛ la. Fɛnw jɔcogo ye : delay: { "show": 500, "hide": 100 }.
fallbackPlacements sɛrɛ, sɛrɛkili ['top', 'right', 'bottom', 'left'] Fallback yɔrɔw ɲɛfɔ ni yɔrɔw lisɛli ye array kɔnɔ (ka kɛɲɛ ni u diyanyekow ye). Walasa ka kunnafoni wɛrɛw sɔrɔ, aw ye Popper ka kɛwalew sɛbɛnw lajɛ .
html boolean ye false A to HTML ka don popover kɔnɔ. Ni tiɲɛ don, HTML taamasiyɛn minnu bɛ popover's kɔnɔ, titleolu bɛna jira popover kɔnɔ. Ni nkalon don, innerTextnafolo bɛna kɛ ka kɔnɔkow don DOM kɔnɔ. Baara kɛ ni sɛbɛnni ye ni i bɛ hami XSS binkanniw na.
offset jate, sɛrɛ, baarakɛcogo [0, 0] Offset ka popover ka kɛɲɛ n’a ka laɲini ye. Aw bɛ se ka sɛrɛ dɔ tɛmɛn data attributes kɔnɔ ni nafaw ye minnu faralen don ɲɔgɔn kan ni koma ye i n’a fɔ: data-bs-offset="10,20". Ni baarakɛcogo dɔ bɛ Kɛ ka offset (fɔcogo) dɔn, a bɛ Weele ni fɛn dɔ ye min kɔnɔ popper (poper) bilali, a ka 'reference (fɔlikan) ani popper rects (popper rects) bɛ min na i n'a fɔ a ka argument (fɔlikan) fɔlɔ. Triggering element DOM node bɛ tɛmɛ i n’a fɔ argument filanan. Baarakɛcogo ka kan ka segin sɛrɛkili dɔ kan ni jateden fila ye: skidding , distance . Walasa ka kunnafoni wɛrɛw sɔrɔ, aw ye Popper ka offset docs lajɛ .
placement sɛrɛ, baarakɛcogo 'top' Popover sigicogo: auto, sanfɛ, duguma, kinin fɛ, kinin fɛ. Ni autoa ɲɛfɔra, a bɛna popover ɲɛsin kokura ni fanga ye. Ni baarakɛcogo dɔ bɛ Kɛ ka jɔyɔrɔko Labɛn, a bɛ Weele ni popover DOM node ye a ka argument fɔlɔ ye ani triggering element DOM node k'a Kɛ a filanan ye. A thiskɔnɔkow bɛ sigi popover misali la.
popperConfig null, fɛn, baara null Walasa ka Bootstrap ka Popper config default Changer, aw ye Popper ka configuration lajɛ . Ni baarakɛcogo dɔ bɛ Kɛ ka Popper labɛncogo Dabɔ, a bɛ Weele ni fɛn dɔ ye min kɔnɔ Bootstrap ka Popper labɛncogo kɔrɔ bɛ yen. A b’i dɛmɛ ka baara kɛ ni default ye ani k’a fara ɲɔgɔn kan ni i yɛrɛ ka configuration ye. Baarakɛcogo ka kan ka segin labɛnni fɛn dɔ kan Popper ye.
sanitize boolean ye true Saniyali in daminɛ walima k’a bali. Ni activated 'template', 'content'ani 'title'sugandiliw bɛna saniya.
sanitizeFn null, baarakɛcogo null Yan aw bɛ se ka aw yɛrɛ ka sanitize baarakɛcogo di. O bɛ se ka kɛ nafa ye ni aw b’a fɛ ka baara kɛ ni gafemarayɔrɔ kɛrɛnkɛrɛnnen ye walasa ka saniya kɛ.
selector juru, nkalon false Ni sugandili dɔ dira, popover fɛnw bɛna di laɲini kofɔlenw ma. Tiɲɛ na, o bɛ Kɛ ka popovers fana Kɛ DOM elements ( jQuery.ondɛmɛni) faralen ɲɔgɔn kan ni fanga ye. aw ye nin bɔko in lajɛ ani misali min bɛ kunnafoni di .
template gaari '<div class="popover" role="popover"><div class="popover-arrow"></div><div class="popover-inner"></div></div>' Base HTML ka baara kɛ ni popover dabɔli ye. Popover's titlebɛna pikiri kɛ .popover-inner. .popover-arrowbɛna kɛ popover ka bɛlɛkisɛ ye. Kɛnɛma dakun ka kan ka kɛ ni .popoverkalasi ni role="popover".
title sɛrɛ, fɛn, baarakɛcogo '' Title nafa dafalen ni titleattribut tɛ yen. Ni baara dɔ dira, a bɛ Weele n'a ka this'reference set ye popover bɛ nɔrɔ min na.
trigger gaari 'hover focus' Popover bɛ daminɛ cogo min na: click, hover, focus, manual. Aw bɛ se ka tɛmɛ fɛn caman fɛ minnu bɛ se ka kɛ sababu ye; u fara ɲɔgɔn kan ni yɔrɔ dɔ ye. 'manual'b’a jira ko popover bɛna daminɛ porogaramu fɛ .popover('show'), .popover('hide')ani .popover('toggle')fɛɛrɛw fɛ; o nafa tɛ se ka fara ɲɔgɔn kan ni fɛn wɛrɛ ye min bɛ se ka kɛ sababu ye. 'hover'a yɛrɛ la, o bɛna kɛ sababu ye ka popoverw sɔrɔ minnu tɛ se ka daminɛ ni klaviyeti ye, wa u ka kan ka baara kɛ dɔrɔn ni fɛɛrɛ wɛrɛw bɛ yen minnu bɛ se ka kunnafoni kelenw lase klaviyeti baarakɛlaw ma.

Data attributes ka ɲɛsin popover kelen-kelen bɛɛ ma

Sugandili minnu bɛ kɛ popover kelen-kelenw na, olu bɛ se ka ɲɛfɔ cogo wɛrɛ la ni kunnafonidilanw ka fɛnw ye, i n’a fɔ a ɲɛfɔlen don cogo min na sanfɛ.

Baara kɛ ni baarakɛcogo ye nipopperConfig

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

Fɛɛrɛw

Fɛɛrɛ minnu tɛ kelen ye ani fɛn caman tigɛli

API fɛɛrɛw bɛɛ ye asynchrone ye ani ka tɛmɛsira dɔ daminɛ . u bɛ segin welebaga ma ni wuli daminɛna dɔrɔn nka sanni a ka ban . Ka fara o kan, fɛɛrɛ weleli min bɛ kɛ tɛmɛsira yɔrɔ dɔ kan, o bɛna jate .

aw ye an ka JavaScript sɛbɛnw lajɛ walasa ka kunnafoni wɛrɛw sɔrɔ .

Kɛcogo Cogojirali
disable A bɛ seko bɔ ka ɲɛsin element dɔ ka popover jirali ma. Popover bɛna se ka jira dɔrɔn ni a daminɛna kokura.
dispose A bɛ fɛn dɔ ka popover dogo ani k’a tiɲɛ (A bɛ kunnafoni maralenw bɔ DOM fɛn kan). Popovers minnu bɛ baara Kɛ ni delegation ye (minnu bɛ Dabɔ ni option selectorye ) tɛ Se ka Tiɲɛ kelen-kelen na descendant trigger elements kan.
enable A bɛ element dɔ ka popover seko jira ka jira. Popovers bɛ baara kɛ ni default ye.
getInstance Static method min b’a to i bɛ se ka popover instance sɔrɔ min bɛ tali kɛ DOM element dɔ la.
getOrCreateInstance Static method min b’a To i bɛ popover instance sɔrɔ min bɛ tali Kɛ DOM element dɔ la, walima ka kura Dabɔ n’a sɔrɔla a ma daminɛ.
hide A bɛ element dɔ ka popover dogo. A bɛ Segin welebaga ma sani popover ka dogo tiɲɛ na (o kɔrɔ ye ko sanni ko hidden.bs.popoverin ka Kɛ). O bɛ jate “bolola” ye min bɛ popover (popover) daminɛ.
setContent A bɛ fɛɛrɛ Di ka popover kɔnɔkow Changer a daminɛ kɔfɛ.
show A bɛ element dɔ ka popover jira. A bɛ Segin welebaga ma sani popover ka jira tiɲɛ na (o kɔrɔ ye ko sanni ko shown.bs.popoverin ka Kɛ). O bɛ jate “bolola” ye min bɛ popover (popover) daminɛ. Popovers minnu tɔgɔ ni u kɔnɔkow bɛɛ ye zeru-janya ye, olu tɛ jira abada.
toggle A bɛ fɛn dɔ ka popover wuli. A bɛ segin welebaga ma sanni popover ka jira tiɲɛ na walima ka dogo (o kɔrɔ ye ko sanni shown.bs.popoverwalima hidden.bs.popoverko kɛlen ka kɛ). O bɛ jate “bolola” ye min bɛ popover (popover) daminɛ.
toggleEnabled A bɛ se ka fɛn dɔ ka popover jira walima ka dogo.
update A bɛ element dɔ ka popover jɔyɔrɔ kura.
// 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'
})
Fɛɛrɛ setContentbɛ Sɔn objectsɔsɔli ma, yɔrɔ min na nafolo- stringkɔlɔsilikɛlan kelen-kelen bɛɛ ye sugandilikɛla ɲuman ye popover jatebɔlan kɔnɔ, ani nafolo-nafa kelen-kelen min bɛ tali Kɛ a la bɛ Se ka Kɛ string| element| function| null

Ko minnu kɛra

Lajɛrɛ Cogojirali
hide.bs.popover O ko in bɛ Fɔ o yɔrɔnin bɛɛ ni hidemisali fɛɛrɛ Weelera.
hidden.bs.popover O ko in bɛ Bɔ ni popover dogolen Banna baarakɛla fɛ (a bɛna CSS 'tɛmɛsiraw makɔnɔ u ka ban).
inserted.bs.popover O ko in bɛ Bɔ kɛnɛ kan ko kɛlen kɔfɛ show.bs.popoverni popover template farala DOM kan.
show.bs.popover O ko in bɛ tasuma Bɔ o yɔrɔnin bɛɛ ni showmisali fɛɛrɛ Weelela.
shown.bs.popover O ko in bɛ Bɔ ni popover Kɛra yelen ye baarakɛla fɛ (a bɛna CSS 'tɛmɛsiraw makɔnɔ u ka ban).
const myPopoverTrigger = document.getElementById('myPopover')
myPopoverTrigger.addEventListener('hidden.bs.popover', () => {
  // do something...
})