Iingcebiso
Amaxwebhu kunye nemizekelo yokongeza iingcebiso zesiko le-Bootstrap ngeCSS kunye neJavaScript usebenzisa i-CSS3 yoopopayi kunye nedatha-bs-impawu zogcino lwesihloko sendawo.
Isishwankathelo
Izinto omawuzazi xa usebenzisa iplagi yesixhobo se-tooltip:
- Iingcebiso zezixhobo zixhomekeke kwithala leencwadi lesithathu iPopper ngokubekwa . Kufuneka ubandakanye popper.min.js phambi
bootstrap.js
, okanye usebenzise enyebootstrap.bundle.min.js
enePopper. - Iingcebiso zezixhobo zingenile ngenxa yezizathu zokusebenza, ke kufuneka uziqalise ngokwakho .
- Iingcebiso zezixhobo ezinezihloko ezibude buziro aziboniswa.
- Cacisa
container: 'body'
ukunqanda unikezelo lweengxaki kumacandelo antsokothileyo (njengamaqela ethu egalelo, amaqela amaqhosha, njl.njl). - Iingcebiso zokuqalisa kwizinto ezifihlakeleyo aziyi kusebenza.
- Iingcebiso zesixhobo
.disabled
okanyedisabled
izakhi kufuneka zivuswe kuphawu lokusonga. - Xa iqaliswa ukusuka kwiihyperlink ezithatha imigca emininzi, iincam zesixhobo ziya kugxilwa. Sebenzisa
white-space: nowrap;
kwi yakho<a>
ukunqanda le ukuziphatha. - Iingcebiso kufuneka zifihlwe phambi kokuba izinto ezihambelanayo nazo zisuswe kwiDOM.
- Iingcebiso zesixhobo zinokuqhutywa enkosi kwinto engaphakathi kwesithunzi se-DOM.
Unayo yonke loo nto? Kulungile, makhe sibone ukuba basebenza njani ngemizekelo ethile.
prefers-reduced-motion
kumbuzo wemidiya. Jonga icandelo
leentshukumo ezincitshisiweyo kuxwebhu lwethu lofikelelo .
Imizekelo
Vula iingcebiso zesixhobo
Njengoko kukhankanyiwe ngasentla, kufuneka uqalise iingcebiso zesixhobo ngaphambi kokuba zisetyenziswe. Enye indlela yokuqalisa zonke iingcebiso zesixhobo kwiphepha inokuba kukukhetha ngophawu lwazo data-bs-toggle
, ngolu hlobo:
const tooltipTriggerList = document.querySelectorAll('[data-bs-toggle="tooltip"]')
const tooltipList = [...tooltipTriggerList].map(tooltipTriggerEl => new bootstrap.Tooltip(tooltipTriggerEl))
Iingcebiso kwikhonkco
Hambisa ngaphezulu kwezi linki zingezantsi ukuze ubone iingcebiso zesixhobo:
Isiqendu sesibambi-ndawo sokubonisa amakhonkco angaphakathi ngengcebiso yesixhobo. Oku ngoku kukugcwalisa nje, akukho mbulali. Umxholo obekwe apha ukulinganisa ubukho bombhalo wokwenyani . Kwaye konke oko ukukunika umbono wendlela izixhobo zokusebenza ezinokuthi zijongeke ngayo xa zisetyenziswa kwiimeko zokwenyani zehlabathi. Ke ngethemba ukuba ngoku sele ubonile ukuba ezi ngcebiso zesixhobo kwiikhonkco zinokusebenza njani, nje ukuba uzisebenzise kwindawo yakho okanye kwiprojekthi.
<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
yakho
data-bs-title
. Xa
title
isetyenziswa, iPopper iya kuyibuyisela ngokuzenzekelayo
data-bs-title
xa i element inikezelwa.
Iingcebiso zezixhobo ezilungiselelweyo
Ifakwe kwi-v5.2.0Unokwenza inkangeleko yeengcebiso zesixhobo usebenzisa iCSS variables . Siseta iklasi yesiko data-bs-custom-class="custom-tooltip"
ukuze sijonge inkangeleko yethu yesiko kwaye siyisebenzise ukodlula ukuguquguquka kweCSS yendawo.
.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>
Izalathiso
Hambisa phezu kwamaqhosha angezantsi ukuze ubone izalathiso zezixhobo ezine: phezulu, ekunene, ezantsi, nasekhohlo. Izalathiso ziboniswa xa usebenzisa i-Bootstrap kwi-RTL.
<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>
Kwaye nge-HTML yesiko elongeziweyo:
<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>
Nge-SVG:
CSS
Izinto eziguquguqukayo
Ifakwe kwi-v5.2.0Njengenxalenye yendlela yokuguquguquka kwe-Bootstrap ye-CSS, iingcebiso zesixhobo ngoku zisebenzisa izinto eziguquguqukayo ze-CSS zasekhaya .tooltip
ukuze kuphuculwe ukwenziwa ngokwezifiso kwexesha lokwenyani. Amaxabiso okuguquguquka kweCSS asetwe ngeSass, ngoko ke ukwenziwa ngokwezifiso kweSass kusaxhaswa, nako.
--#{$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};
Iinguqu zeSass
$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
Ukusetyenziswa
Isixhobo se-plugin se-tooltip sivelisa umxholo kunye ne-markup kwimfuno, kwaye ngokungagqibekanga iindawo zeengcebiso zesixhobo emva kwento yazo ye-trigger.
Qalisa ingcebiso yesixhobo ngeJavaScript:
const exampleEl = document.getElementById('example')
const tooltip = new bootstrap.Tooltip(exampleEl, options)
Ukuphuphuma auto
kwayescroll
Indawo yengcebiso yesixhobo izama ukuzitshintsha ngokuzenzekelayo xa isikhongozeli somzali sinaso okanye overflow: auto
sisithanda overflow: scroll
, .table-responsive
kodwa sigcina indawo ebekuyo yokuqala. Ukusombulula oku, cwangcisa boundary
ukhetho (lomlungisi we-flip usebenzisa popperConfig
ukhetho) kuyo nayiphi na iSiqalelo se-HTML ukukhuphela ngaphezulu ixabiso elingagqibekanga, 'clippingParents'
elinje document.body
:
const tooltip = new bootstrap.Tooltip('#example', {
boundary: document.body // or document.querySelector('#boundary')
})
IMarkup
Uphawu olufunekayo lwencam yesixhobo luphawu kuphela data
kwaye title
kwisiqalelo se-HTML unqwenela ukuba nencam yesixhobo. Uphawu oluveliswayo lwencam yesixhobo lulula, nangona lufuna indawo (ngokungagqibekanga, top
lumiselwe yiplagi).
Ukwenza iingcebiso zesixhobo zisebenzele ikhibhodi kunye nabasebenzisi betekhnoloji abancedisayo
Kufuneka wongeze kuphela iingcebiso zesixhobo kwizinto ze-HTML ngokwesiko zekhibhodi-ejolise kwaye isebenze (ezifana namakhonkco okanye ulawulo lwefom). Nangona izinto ze-HTML ezingenamkhethe (ezinje nge- <span>
s) zinokwenziwa ziqwalaselwe ngokongeza tabindex="0"
uphawu, oku kuyakongeza ukumisa okunokucaphukisa kunye nokubhidanisa ithebhu kwizinto ezingasebenzisaniyo kubasebenzisi bebhodi yezitshixo, kwaye uninzi lwetekhnoloji encedisayo ngoku ayazisi inqaku lesixhobo kule meko. Ukongeza, ungathembeli kuphela hover
njengesixhobo sesixhobo sakho, njengoko oku kuya kwenza ukuba izixhobo zakho zesixhobo zingenzeki ukuqalisa kubasebenzisi bebhodi yezitshixo.
<!-- 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>
Izinto ezikhubazekileyo
Izinto disabled
ezinophawu azisebenzi, nto leyo ethetha ukuba abasebenzisi abanakugxila, bashukume, okanye bacofe ukuze baqalise ingcebiso yesixhobo (okanye ipopover). Njengomsebenzi owenziweyo, uya kufuna ukuqalisa inqaku lesixhobo ukusuka kwisonga <div>
okanye <span>
, eyenziwe ngokufanelekileyo i-keyboard-ijolise ekusebenziseni 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>
Iinketho
Njengoko iinketho zinokugqithiswa ngeempawu zedatha okanye iJavaScript, unokongeza igama lokhetho ku data-bs-
, njengakwi data-bs-animation="{value}"
. Qinisekisa ukuba utshintshe uhlobo lwecala legama lokukhetha ukusuka kwi " camelCase " ukuya kwi " kebab-case " xa udlula iinketho ngeempawu zedatha. Umzekelo, sebenzisa data-bs-custom-class="beautifier"
endaweni ye- data-bs-customClass="beautifier"
.
Ukusukela kwi-Bootstrap 5.2.0, onke amacandelo axhasa umlinganiso wedatha ogciniweyo wovavanyodata-bs-config
onokubeka uqwalaselo lwecandelo olulula njengomtya we-JSON. Xa into ineempawu data-bs-config='{"delay":0, "title":123}'
kunye data-bs-title="456"
neempawu, ixabiso lokugqibela title
liya kuba 456
kunye neempawu zedatha eyahlukileyo ziya kuwenza ngaphezulu amaxabiso anikiweyo data-bs-config
. Ukongeza, iimpawu zedatha ezikhoyo ziyakwazi ukubeka ixabiso le-JSON njenge data-bs-delay='{"show":0,"hide":150}'
.
sanitize
,
sanitizeFn
, kunye
allowList
neenketho azikwazi kunikezelwa kusetyenziswa iimpawu zedata.
Igama | Uhlobo | Ukuhlala kukho | Inkcazo |
---|---|---|---|
allowList |
into | Ixabiso elimiselweyo | Into equlathe iimpawu ezivumelekileyo kunye neethegi. |
animation |
boolean | true |
Faka inguqu ye-CSS fade kwi-tooltip. |
boundary |
umtya, isiqalelo | 'clippingParents' |
Umda wothintelo lokuphuphumala kwesixhobo (usebenza kuphela kwisilungisi sePopper sokuthintela ukuphuphuma). Ngokungagqibekanga, 'clippingParents' ilungile kwaye inokwamkela ireferensi yeHTMLElement (ngeJavaScript kuphela). Ngolwazi oluthe vetshe jonga kuPopper's detectOverflow amaxwebhu . |
container |
umtya, isiqalelo, bubuxoki | false |
Ihlomela incam yesixhobo kwinto ethile. Umzekelo: container: 'body' . Olu khetho luluncedo kakhulu kuba lukuvumela ukuba ubeke incam yesixhobo sokuhamba koxwebhu kufutshane nesiqalo esixhobisayo - esiza kuthintela incam yesixhobo ekudada kuyo ukusuka kwinto exhokonxayo ngexesha lokutshintsha ubungakanani befestile. |
customClass |
umtya, umsebenzi | '' |
Yongeza iiklasi kwincam yesixhobo xa ibonisiwe. Qaphela ukuba ezi klasi ziya kongezwa ukongeza kuzo naziphi na iiklasi ezichazwe kwithempleyithi. Ukongeza iiklasi ezininzi, zahlule ngezithuba: 'class-1 class-2' . Ungaphinda ugqithise umsebenzi ozakubuyisela umtya omnye oqulathe amagama odidi olongezelelweyo. |
delay |
inani, into | 0 |
Ukulibaziseka kokubonisa kunye nokufihla incam yesixhobo (ms)—akusebenzi kuhlobo lwesixhobo sokuxhobisa. Ukuba inani linikiwe, ukulibaziseka kufakwa kuzo zombini ezifihla/umboniso. Ulwakhiwo lwento yile: delay: { "show": 500, "hide": 100 } . |
fallbackPlacements |
uluhlu | ['top', 'right', 'bottom', 'left'] |
Chaza ukubekelwa umva ngokubonelela ngoluhlu lweendawo ezibekwe kuluhlu (ngolandelelwano olukhethwayo). Ngolwazi oluthe vetshe jonga kumaxwebhu okuziphatha kaPopper . |
html |
boolean | false |
Vumela i-HTML kwincam yesixhobo. Ukuba yinyaniso, iithegi ze-HTML kwincam yesixhobo title ziya kunikezelwa kwincam yesixhobo. Ukuba asiyonyani, innerText ipropathi iya kusetyenziswa ukufaka umxholo kwiDOM. Sebenzisa umbhalo ukuba unexhala malunga nohlaselo lwe-XSS. |
offset |
uluhlu, umtya, umsebenzi | [0, 0] |
Iseti yesixhobo esinxulumene noko kujoliswe kuko. Ungagqithisa umtya kwiimpawu zedatha enamaxabiso owahlulwe ngokwekoma njenge: data-bs-offset="10,20" . Xa umsebenzi usetyenziselwa ukumisela i-offset, ibizwa ngento equlethe i-popper placement, ireferensi, kunye ne-popper rects njengengxabano yayo yokuqala. Isiqalo se-DOM node sigqithiselwe njengengxoxo yesibini. Umsebenzi kufuneka ubuyisele uluhlu olunamanani amabini: ukutyibilika , umgama . Ngolwazi oluthe vetshe jonga kumaxwebhu e-Popper's offset . |
placement |
umtya, umsebenzi | 'top' |
Uyibeka njani incam yesixhobo: auto, phezulu, ezantsi, ekhohlo, ekunene. Xa auto ikhankanyiwe, izakuhlengahlengisa kwakhona incam yesixhobo. Xa umsebenzi usetyenziswa ukumisela ukubekwa, ubizwa ngokuba nencam yesixhobo ye-DOM njengengxoxo yayo yokuqala kunye nesiqalo se-DOM node njengesibini sayo. Umxholo this umiselwe kumzekelo wencam yesixhobo. |
popperConfig |
null, into, umsebenzi | null |
Ukutshintsha uqwalaselo lwePopper olungagqibekanga lweBootstrap, bona uqwalaselo lwePopper . Xa umsebenzi usetyenziswa ukwenza uqwalaselo lwePopper, ibizwa ngento equlathe uqwalaselo lwePopper yeBootstrap engagqibekanga. Ikunceda ukuba usebenzise kwaye udibanise ukungagqibeki kunye noqwalaselo lwakho. Umsebenzi kufuneka ubuyisele into yoqwalaselo yePopper. |
sanitize |
boolean | true |
Yenza okanye uvale ucoceko. Ukuba ivuliwe 'template' , 'content' kwaye 'title' iinketho ziyakuhlanjululwa. |
sanitizeFn |
null, umsebenzi | null |
Apha ungabonelela ngomsebenzi wakho wokucoca. Oku kunokuba luncedo ukuba ukhetha ukusebenzisa ithala leencwadi elizinikeleyo ukwenza ucoceko. |
selector |
umtya, bubuxoki | false |
Ukuba umkhethi unikiwe, izixhobo zesixhobo ziya kunikezelwa kwiithagethi ezichaziweyo. Ngokwesiqhelo, oku kusetyenziselwa ukusebenzisa iingcebiso zesixhobo kwizinto ezongeziweyo zeDOM ( jQuery.on inkxaso). Jonga lo mbandela kunye nomzekelo ofundisayo . |
template |
umtya | '<div class="tooltip" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>' |
Isiseko se-HTML esinokusetyenziswa xa usenza ingcebiso yesixhobo. Isixhobo se-tooltip title siyakutofwa kwifayile ye .tooltip-inner . .tooltip-arrow iya kuba lutolo lwesixhobo. Isiqalelo sokusonga sangaphandle kufuneka sibe .tooltip neklasi kunye role="tooltip" . |
title |
umtya, isiqalelo, umsebenzi | '' |
Ixabiso lesihloko esihlala sihleli ukuba title uphawu loyelelwano alukho. Ukuba umsebenzi unikiwe, uya kubizwa ngokuba this nereferensi iseti kwinto edityaniswe nepopover. |
trigger |
umtya | 'hover focus' |
Ivuswa njani ithiphu yesixhobo: cofa, hambisa phezulu, gxila, imanyuwali. Unokudlula izichukumisi ezininzi; bahlule ngesithuba. 'manual' ibonisa ukuba incam yesixhobo iya kuqhutywa ngokwenkqubo nge .tooltip('show') , .tooltip('hide') kunye .tooltip('toggle') neendlela; eli xabiso alinakudityaniswa naso nasiphi na esinye isiqhumiso. 'hover' ngokwayo iyakukhokelela kwiingcebiso zesixhobo ezingenakuqaliswa ngebhodi yezitshixo, kwaye kufuneka isetyenziswe kuphela ukuba ezinye iindlela zokuhambisa ulwazi olufanayo kubasebenzisi bebhodi yezitshixo zikhona. |
Iimpawu zedatha kwiingcebiso zesixhobo ngasinye
Iinketho zeengcebiso zesixhobo ngasinye zinokuchazwa ngokusetyenziswa kweempawu zedatha, njengoko kucacisiwe ngasentla.
Ukusebenzisa umsebenzi ngepopperConfig
const tooltip = new bootstrap.Tooltip(element, {
popperConfig(defaultBsPopperConfig) {
// const newPopperConfig = {...}
// use defaultBsPopperConfig if needed...
// return newPopperConfig
}
})
Iindlela
Iindlela ze-Asynchronous kunye notshintsho
Zonke iindlela ze-API zi -asynchronous kwaye ziqala utshintsho . Babuyela kumnxeba ngokukhawuleza nje ukuba utshintsho luqalisiwe kodwa ngaphambi kokuba luphele . Ukongeza, ukufowunelwa kwendlela kwicandelo lenguquko kuya kuhoywa .
Indlela | Inkcazo |
---|---|
disable |
Isusa isakhono sesixhobo sesixhobo sokuboniswa. Ingcebiso yesixhobo iya kuboniswa kuphela ukuba yenziwe yasebenza kwakhona. |
dispose |
Ifihla kwaye itshabalalise isixhobo sesixhobo (Isusa idatha egciniweyo kwinto yeDOM). Iingcebiso zesixhobo ezisebenzisa unikezelo (ezenziwe ngokusetyenziswa kokhethoselector ) azinakutshatyalaliswa zizodwa kwizinto ezibangela ukuvela . |
enable |
Inika isixhobo sesixhobo sokukwazi ukuboniswa. Iingcebiso zesixhobo zenziwe ngokwendalo. |
getInstance |
Indlela engatshintshiyo ekuvumela ukuba ufumane inqaku lesixhobo elinxulunyaniswa nento yeDOM, okanye wenze entsha ukuba ayiqalwanga. |
getOrCreateInstance |
Indlela engatshintshiyo ekuvumela ukuba ufumane inqaku lesixhobo elinxulunyaniswa nento yeDOM, okanye wenze entsha ukuba ayiqalwanga. |
hide |
Ifihla incam yesixhobo. Ibuyisela kumnxeba phambi kokuba incam yesixhobo ifihliwe (okt phambi kokuba hidden.bs.tooltip isiganeko senzeke). Oku kuthathwa ngokuba "yimanyuwali" yokuqalisa inqaku lesixhobo. |
setContent |
Inika indlela yokutshintsha umxholo wesixhobo emva kokuqalwa kwayo. |
show |
Ityhila inqaku lesixhobo. Ibuyisela kumnxebi phambi kokuba incam yesixhobo iboniswe (okt phambi kokuba shown.bs.tooltip isiganeko senzeke). Oku kuthathwa ngokuba "yimanyuwali" yokuqalisa inqaku lesixhobo. Iingcebiso zezixhobo ezinezihloko ezibude buziro aziboniswa. |
toggle |
Itshintshela incam yesixhobo. Ibuyisela kumnxebi phambi kokuba incam yesixhobo iboniswe okanye ifihlwe (okt phambi kokuba isiganeko shown.bs.tooltip okanye hidden.bs.tooltip isiganeko senzeke). Oku kuthathwa ngokuba "yimanyuwali" yokuqalisa inqaku lesixhobo. |
toggleEnabled |
Iguqula isakhono sesixhobo sesixhobo sokuboniswa okanye ukufihlwa. |
update |
Ihlaziya indawo yesixhobo sesixhobo. |
const tooltip = bootstrap.Tooltip.getInstance('#example') // Returns a Bootstrap tooltip instance
// setContent example
tooltip.setContent({ '.tooltip-inner': 'another title' })
setContent
yamkela
object
ingxoxo, apho isitshixo sepropathi ngasinye singumkhethi osebenzayo
string
ngaphakathi kwetemplate yepopover, kwaye ixabiso lepropathi ngalinye elinxulumeneyo linokuba
string
|
element
|
function
|
null
Iziganeko
Isiganeko | Inkcazo |
---|---|
hide.bs.tooltip |
Esi siganeko sigxothwa ngokukhawuleza xa hide indlela yomzekelo ibiziwe. |
hidden.bs.tooltip |
Esi siganeko sigxothwa xa i-popover igqibile ukufihlwa kumsebenzisi (iya kulinda iinguqu zeCSS ukuba zigqibe). |
inserted.bs.tooltip |
Esi siganeko sigxothwa emva show.bs.tooltip kwesiganeko xa ithemplate ye-tooltip yongezwa kwi-DOM. |
show.bs.tooltip |
Esi siganeko sivutha ngokukhawuleza xa show kubizwa indlela yomzekelo. |
shown.bs.tooltip |
Esi siganeko sigxothwa xa i-popover yenziwe yabonakala kumsebenzisi (iya kulinda iinguqu zeCSS ukuba zigqibe). |
const myTooltipEl = document.getElementById('myTooltip')
const tooltip = bootstrap.Tooltip.getOrCreateInstance(myTooltipEl)
myTooltipEl.addEventListener('hidden.bs.tooltip', () => {
// do something...
})
tooltip.hide()