Baarakɛminɛnw ladilikanw
Sɛbɛnw ni misaliw ka ɲɛsin Bootstrap baarakɛminɛnw ladamulenw farali kan ni CSS ani JavaScript ye ni CSS3 ye animationw kama ani data-bs-attributes sigida tɔgɔw marali kama.
Kuma bɛɛ lajɛlen
Fɛn minnu ka kan ka dɔn ni i bɛ baara kɛ ni baarakɛminɛnw ye:
- Baarakɛminɛnw bɛ tali kɛ 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ɔ yebootstrap.bundle.min.js
min kɔnɔ Popper bɛ yen. - Baarakɛminɛnw ladilikanw ye opt-in ye baarakɛcogo kunw na, o la i yɛrɛ ka kan k’u daminɛ .
- Baarakɛminɛn minnu tɔgɔw ye zeru janya ye, olu tɛ 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). - Baarakɛminɛnw bilali daminɛni fɛn dogolenw kan, o tɛna baara kɛ.
- Baarakɛminɛnw ladilikanw for
.disabled
walimadisabled
elements ka kan ka daminɛ wrapper element kan. - Ni a daminɛna ka bɔ hyperlinkw la minnu bɛ zana caman bɔ, baarakɛminɛnw bɛna kɛ cɛmancɛ la. Aw
white-space: nowrap;
bɛ baara kɛ ni aw ka<a>
s ye walasa ka aw yɛrɛ tanga nin kɛcogo in ma. - Baarakɛminɛnw ka kan ka dogo sani u bɛnkanw ka bɔ DOM kɔnɔ.
- Baarakɛminɛnw bɛ Se ka Lawuli k’a sababu Kɛ fɛn dɔ ye min bɛ DOM biɲɛ dɔ kɔnɔ.
I ye o bɛɛ sɔrɔ wa? A ka bon, an k’a lajɛ u bɛ baara kɛ cogo min na ni misali dɔw ye.
prefers-reduced-motion
media ɲininkali de la. aw ye
an ka sɔrɔli sɛbɛnw yɔrɔ lajɛ min bɛ lamaga dɔgɔyalen na .
Misaliw
Baarakɛminɛnw laadilikanw daminɛ
I n’a fɔ a fɔra cogo min na sanfɛ, aw ka kan ka baarakɛminɛnw daminɛ sani u ka se ka baara kɛ ni u ye. Baarakɛminɛnw bɛɛ daminɛcogo dɔ ɲɛ dɔ kan, o ye k’u sugandi u cogoya fɛ data-bs-toggle
, i n’a fɔ:
const tooltipTriggerList = document.querySelectorAll('[data-bs-toggle="tooltip"]')
const tooltipList = [...tooltipTriggerList].map(tooltipTriggerEl => new bootstrap.Tooltip(tooltipTriggerEl))
Baarakɛminɛnw ladilikanw minnu bɛ tali kɛ jɛgɛnsira kan
I bolo digi jukɔrɔla yɔrɔw kan walasa ka baarakɛminɛnw lajɛ:
Yɔrɔ-sɛbɛnni walasa ka jɛgɛnsira dɔw jira ni baarakɛminɛnw ye. Nin ye sisan filɛli dɔrɔn de ye, mɔgɔfagala tɛ. kɔnɔkow bilalen bɛ yan dɔrɔn walasa ka sɛbɛn lakika sɔrɔli ladege . Wa o bɛɛ bɛ kɛ dɔrɔn walasa ka hakilina di i ma baarakɛminɛnw laadilikanw bɛna kɛ cogo min na ni u bɛ baara kɛ ni u ye diɲɛ ko lakikaw la. O la jigiya b’a la ko i y’a Ye sisan cogo min na nin baarakɛminɛn ninnu bɛ Se ka baara Kɛ waleyali la, n’i y’u Kɛ i yɛrɛ ka siti walima i ka porozɛ kan.
<p class="muted">Placeholder text to demonstrate some <a href="#" data-bs-toggle="tooltip" data-bs-title="Default tooltip">inline links</a> with tooltips. This is now just filler, no killer. Content placed here just to mimic the presence of <a href="#" data-bs-toggle="tooltip" data-bs-title="Another tooltip">real text</a>. And all that just to give you an idea of how tooltips would look when used in real-world situations. So hopefully you've now seen how <a href="#" data-bs-toggle="tooltip" data-bs-title="Another one here too">these tooltips on links</a> can work in practice, once you use them on <a href="#" data-bs-toggle="tooltip" data-bs-title="The last tip!">your own</a> site or project.
</p>
title
walima
data-bs-title
aw ka HTML kɔnɔ. Ni
title
a bɛ baara kɛ, Popper bɛna a bila a nɔ na a yɛrɛma ni
data-bs-title
element in bɛ jira.
Baarakɛminɛn minnu bɛ kɛ ka kɛɲɛ ni mɔgɔw sago ye
A farala a kan v5.2.0 kɔnɔaw bɛ se ka baarakɛminɛnw 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-tooltip"
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-tooltip {
--bs-tooltip-bg: var(--bs-primary);
}
<button type="button" class="btn btn-secondary"
data-bs-toggle="tooltip" data-bs-placement="top"
data-bs-custom-class="custom-tooltip"
data-bs-title="This top tooltip is themed via CSS variables.">
Custom tooltip
</button>
Yɔrɔ jiracogo
I bolo digi butɔni kan minnu bɛ duguma walasa ka baarakɛminɛnw jiracogo naani ye: sanfɛ, kinin fɛ, duguma ani numan fɛ. Siraw bɛ miiri ni Bootstrap ye RTL kɔnɔ.
<button type="button" class="btn btn-secondary" data-bs-toggle="tooltip" data-bs-placement="top" data-bs-title="Tooltip on top">
Tooltip on top
</button>
<button type="button" class="btn btn-secondary" data-bs-toggle="tooltip" data-bs-placement="right" data-bs-title="Tooltip on right">
Tooltip on right
</button>
<button type="button" class="btn btn-secondary" data-bs-toggle="tooltip" data-bs-placement="bottom" data-bs-title="Tooltip on bottom">
Tooltip on bottom
</button>
<button type="button" class="btn btn-secondary" data-bs-toggle="tooltip" data-bs-placement="left" data-bs-title="Tooltip on left">
Tooltip on left
</button>
Ani ni HTML ladamulen farala a kan:
<button type="button" class="btn btn-secondary" data-bs-toggle="tooltip" data-bs-html="true" data-bs-title="<em>Tooltip</em> <u>with</u> <b>HTML</b>">
Tooltip with HTML
</button>
Ni SVG ye:
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ɛ min bɛ ka wuli ka taa a fɛ, o hukumu kɔnɔ, baarakɛminɛnw laadilikanw bɛ baara kɛ sisan ni sigida CSS fɛn caman sɛgɛsɛgɛli ye on .tooltip
walasa ka waati yɛrɛyɛrɛ ladamucogo ɲɛ. 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}tooltip-zindex: #{$zindex-tooltip};
--#{$prefix}tooltip-max-width: #{$tooltip-max-width};
--#{$prefix}tooltip-padding-x: #{$tooltip-padding-x};
--#{$prefix}tooltip-padding-y: #{$tooltip-padding-y};
--#{$prefix}tooltip-margin: #{$tooltip-margin};
@include rfs($tooltip-font-size, --#{$prefix}tooltip-font-size);
--#{$prefix}tooltip-color: #{$tooltip-color};
--#{$prefix}tooltip-bg: #{$tooltip-bg};
--#{$prefix}tooltip-border-radius: #{$tooltip-border-radius};
--#{$prefix}tooltip-opacity: #{$tooltip-opacity};
--#{$prefix}tooltip-arrow-width: #{$tooltip-arrow-width};
--#{$prefix}tooltip-arrow-height: #{$tooltip-arrow-height};
Sass bεε bε bεn
$tooltip-font-size: $font-size-sm;
$tooltip-max-width: 200px;
$tooltip-color: $white;
$tooltip-bg: $black;
$tooltip-border-radius: $border-radius;
$tooltip-opacity: .9;
$tooltip-padding-y: $spacer * .25;
$tooltip-padding-x: $spacer * .5;
$tooltip-margin: null; // TODO: remove this in v6
$tooltip-arrow-width: .8rem;
$tooltip-arrow-height: .4rem;
// fusv-disable
$tooltip-arrow-color: null; // Deprecated in Bootstrap 5.2.0 for CSS variables
// fusv-enable
Baarakɛcogo
Baarakɛminɛnw-kumasenw bɛ kɔnɔkow ni taamasiyɛnw Bɔ ɲinini na, wa a bɛ baarakɛminɛnw bila u ka trigger element kɔfɛ.
Baarakɛminɛn in daminɛ JavaScript fɛ:
const exampleEl = document.getElementById('example')
const tooltip = new bootstrap.Tooltip(exampleEl, options)
Overflow auto
aniscroll
Baarakɛminɛnw jɔyɔrɔ b’a ɲini ka fɛn caman Changer a yɛrɛma ni bangebaga minɛn dɔ bɛ overflow: auto
an overflow: scroll
ka .table-responsive
, nka hali bi a bɛ jɔyɔrɔ fɔlɔ jɔyɔrɔ mara. Walasa k’o ɲɛnabɔ, i ka boundary
sugandi (flip modifier ka baara kɛ ni popperConfig
sugandi ye) sigi HTMLElement o HTMLElement kan walasa ka nafa dafalen, 'clippingParents'
, i n’a fɔ document.body
:
const tooltip = new bootstrap.Tooltip('#example', {
boundary: document.body // or document.querySelector('#boundary')
})
Markup (Marka) ye
Taamaʃyɛn wajibiyalen min bɛ Kɛ baarakɛminɛn dɔ la o ye data
fɛnɲɛnɛma dɔrɔn de ye wa title
HTML yɔrɔ kan i b’a fɛ ka baarakɛminɛn dɔ Sɔrɔ. Baarakɛminɛn dɔ taamasiyɛn min Sɔrɔla o ka nɔgɔn kosɛbɛ, hali n’a bɛ jɔyɔrɔ dɔ de wajibiya (a daminɛ na, a bɛ Blà ‘sèn na top
ni ‘plugin ye).
Baarakɛminɛnw kɛli ka baara kɛ klaviyeti ni dɛmɛni fɛɛrɛw baarakɛlaw ye
I ka kan ka baarakɛminɛnw dɔrɔn de Fàra HTML yɔrɔw kan minnu bɛ Se ka Klaviyeti-yɔrɔ-ko-ɲɛnabɔli Kɛ laada la ani minnu bɛ Se ka Kɛ ɲɔgɔn fɛ (i n’a fɔ jὲɲɔgɔnya walima foroko-kɔlɔsili). Hali ni HTML fɛnw (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ɛ baarakɛminɛnko Laseli sisan nin ko in na. Ka fara o kan, i kana i jigi da dɔrɔn kan hover
i n’a fɔ i ka baarakɛminɛnw labɛncogo, bawo o bɛna a to i ka baarakɛminɛnw tɛ se ka daminɛ klaviyeti baarakɛlaw fɛ.
<!-- HTML to write -->
<a href="#" data-bs-toggle="tooltip" data-bs-title="Some tooltip text!">Hover over me</a>
<!-- Generated markup by the plugin -->
<div class="tooltip bs-tooltip-top" role="tooltip">
<div class="tooltip-arrow"></div>
<div class="tooltip-inner">
Some tooltip text!
</div>
</div>
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 sinsin, k’u jɔ, walima k’u digi walasa ka baarakɛminɛn dɔ (walima popover) dɔ Daminɛ. O kɛcogo la, i b’a fɛ ka baarakɛminɛnw daminɛ ka bɔ wrapper la <div>
walima <span>
, min ka fisa ka kɛ klaviyeti-focusable ye ni tabindex="0"
.
<span class="d-inline-block" tabindex="0" data-bs-toggle="tooltip" data-bs-title="Disabled tooltip">
<button class="btn btn-primary" type="button" disabled>Disabled button</button>
</span>
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 title
bɛna kɛ 456
ani 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}'
.
sanitize
,
sanitizeFn
, ani
allowList
sugandiliw 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 (CSS fade transition) dɔ kɛ baarakɛminɛnw yɔrɔ la. |
boundary |
juru, fɛn dɔ | 'clippingParents' |
Baarakɛminɛnw ka dantigɛli dantigɛli 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ɛ baarakɛminɛnw ɲɛfɔli 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 baarakɛminɛnw bila sɛbɛn in bolicogo la min bɛ daminɛ-yɔrɔ kɛrɛfɛ - o bɛna baarakɛminɛn-yɔrɔ bali ka pan ka Bɔ daminɛ-yɔrɔ la finɛtiri bonya caman cili waati la. |
customClass |
sɛrɛ, baarakɛcogo | '' |
Kalansow fara baarakɛminɛnw kan ni a jiralen don. 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 |
Baarakɛminɛnw jiracogo ni a dogocogo latɛmɛni (ms)—o tɛ tali kɛ bololabaarakɛminɛn 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 |
array (ɲɛnajɛ). | ['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 |
Aw bɛ HTML to baarakɛminɛnw kɔnɔ. Ni tiɲɛ don, HTML taamasiyɛn minnu bɛ baarakɛminɛnw kɔnɔ, title olu bɛna jira baarakɛminɛnw kɔnɔ. Ni nkalon don, innerText nafolo 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 |
array, sɛrɛ, baarakɛcogo | [0, 0] |
Offset of the tooltip ka kɛɲɛ n’a 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' |
Baarakɛminɛnw bilacogo: auto, sanfɛ, duguma, numan fɛ, kinin fɛ. Ni auto a ɲɛfɔra, a bɛna baarakɛminɛnw ɲɛminɛcogo kura jira cogo la min bɛ se ka wuli. Ni baarakɛcogo dɔ bɛ Kɛ ka yɔrɔ-yɔrɔ-ko Labɛn, a bɛ Weele ni baarakɛminɛn-sɛbɛn DOM node ye a ka dalilu fɔlɔ ye ani 'fɛn min bɛ Daminɛ DOM node ye k'o Kɛ a filanan ye. A this kɔnɔkow bɛ sigi baarakɛminɛnw ɲɛfɔli 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, baarakɛminɛnw ɲɛfɔli fɛnw bɛna di laɲini kofɔlenw ma. Tiɲɛ na, o bɛ kɛ ka baarakɛminɛnw fana waleya DOM fɛnw kan minnu bɛ fara ɲɔgɔn kan ni fanga ye ( jQuery.on dɛmɛ). aw ye nin bɔko in lajɛ ani misali min bɛ kunnafoni di . |
template |
gaari | '<div class="tooltip" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>' |
Base HTML ka baara kɛ ni baarakɛminɛnw ɲɛfɔli ye. Baarakɛminɛnw title bɛna pikiri kɛ .tooltip-inner . .tooltip-arrow bɛna kɛ baarakɛminɛnw ka taamasiyɛn ye. Kɛnɛma dakun ka kan ka kɛ ni .tooltip kalasi ni role="tooltip" . |
title |
sɛrɛ, fɛn, baarakɛcogo | '' |
Title nafa dafalen ni title attribut 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' |
Baarakɛminɛnw ɲɛfɔli bɛ daminɛ cogo min na: digi, 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 baarakɛminɛnw bɛna daminɛ porogaramu fɛ .tooltip('show') , .tooltip('hide') ani .tooltip('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 baarakɛminɛnw jira 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. |
Donanw cogoyaw ka ɲɛsin baarakɛminɛn kelen-kelen bɛɛ ma
Sugandili minnu bɛ kɛ baarakɛminɛn kelen-kelen bɛɛ la, olu bɛ se ka ɲɛfɔ cogo wɛrɛ la ni kunnafonidilanw cogoyaw ye, i n’a fɔ a ɲɛfɔlen don cogo min na sanfɛ.
Baara kɛ ni baarakɛcogo ye nipopperConfig
const tooltip = new bootstrap.Tooltip(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ɔ fɛn dɔ ka baarakɛminɛnw jiracogo la. Baarakɛminɛnw ɲɛfɔli bɛna se ka jira dɔrɔn ni a daminɛna kokura. |
dispose |
A bɛ fɛn dɔ ka baarakɛminɛn dɔ dogo ani k’a tiɲɛ (A bɛ kunnafoni maralenw bɔ DOM fɛn kan). Baarakɛminɛn minnu bɛ baara Kɛ ni delegation ye (minnu bɛ Dabɔ ni option selector ye ) tɛ Se ka Tiɲɛ kelen-kelen bɔnsɔn trigger elements kan. |
enable |
A bɛ se di fɛn dɔ ka baarakɛminɛnw ma ka se ka jira. Baarakɛminɛnw ladilikanw bɛ baara kɛ ka daminɛ. |
getInstance |
Fɛɛrɛ jɔlen min b’a To i bɛ se ka baarakɛminɛn instansi Sɔrɔ min bɛ tali Kɛ DOM yɔrɔ dɔ la, walima ka kura Dabɔ n’a sɔrɔla a ma Daminɛ. |
getOrCreateInstance |
Fɛɛrɛ jɔlen min b’a To i bɛ se ka baarakɛminɛn instansi Sɔrɔ min bɛ tali Kɛ DOM yɔrɔ dɔ la, walima ka kura Dabɔ n’a sɔrɔla a ma Daminɛ. |
hide |
A bɛ fɛn dɔ ka baarakɛminɛn dɔ dogo. A bɛ Segin welebaga ma sani baarakɛminɛn in ka dogo tiɲɛ na (o kɔrɔ ye ko sani ko hidden.bs.tooltip in ka Kɛ). O bɛ jate baarakɛminɛnw ɲɛfɔli “bololanɛgɛ” daminɛni ye. |
setContent |
A bɛ fɛɛrɛ Di walasa ka baarakɛminɛnw kɔnɔkow Changer a daminɛ kɔfɛ. |
show |
A bɛ element dɔ ka baarakɛminɛnw jira. A bɛ Segin welebaga ma sani baarakɛminɛn in ka jira tiɲɛ na (o kɔrɔ ye ko sani ko shown.bs.tooltip in ka Kɛ). O bɛ jate baarakɛminɛnw ɲɛfɔli “bololanɛgɛ” daminɛni ye. Baarakɛminɛn minnu tɔgɔw janya ye zeru ye, olu tɛ jira abada. |
toggle |
A bɛ fɛn dɔ ka baarakɛminɛnw sɛgɛsɛgɛli wuli. A bɛ Segin welebaga ma sani baarakɛminɛn in ka jira tiɲɛ na walima ka dogo (o kɔrɔ ye ko sanni shown.bs.tooltip walima hidden.bs.tooltip ko kɛlen ka Kɛ). O bɛ jate baarakɛminɛnw ɲɛfɔli “bololanɛgɛ” daminɛni ye. |
toggleEnabled |
A bɛ seko caman wuli walasa fɛn dɔ ka baarakɛminɛnw ka jira walima ka dogo. |
update |
A bɛ fɛn dɔ ka baarakɛminɛnw jɔyɔrɔ sɛmɛntiya. |
const tooltip = bootstrap.Tooltip.getInstance('#example') // Returns a Bootstrap tooltip instance
// setContent example
tooltip.setContent({ '.tooltip-inner': 'another title' })
setContent
bɛ Sɔn
object
sɔsɔli ma, yɔrɔ min na nafolo-
string
kɔ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.tooltip |
O ko in bɛ Fɔ o yɔrɔnin bɛɛ ni hide misali fɛɛrɛ Weelera. |
hidden.bs.tooltip |
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.tooltip |
O ko in bɛ Bɔ ko kɛlen kɔfɛ show.bs.tooltip ni baarakɛminɛnw jatebɔlan Fàrala DOM kan. |
show.bs.tooltip |
O ko in bɛ tasuma Bɔ o yɔrɔnin bɛɛ ni show misali fɛɛrɛ Weelela. |
shown.bs.tooltip |
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 myTooltipEl = document.getElementById('myTooltip')
const tooltip = bootstrap.Tooltip.getOrCreateInstance(myTooltipEl)
myTooltipEl.addEventListener('hidden.bs.tooltip', () => {
// do something...
})
tooltip.hide()