Cov lus qhia
Cov ntaub ntawv thiab cov piv txwv rau ntxiv cov kev cai Bootstrap cov lus qhia nrog CSS thiab JavaScript siv CSS3 rau cov duab thiab cov ntaub ntawv-bs-tus cwj pwm rau cov npe hauv zos.
Txheej txheem cej luam
Tej yam yuav tsum paub thaum siv tooltip plugin:
- Tooltips cia siab rau lub tsev qiv ntawv thib peb Popper rau qhov chaw. Koj yuav tsum suav nrog popper.min.js ua ntej
bootstrap.js
, lossis siv ib qhobootstrap.bundle.min.js
uas muaj Popper. - Tooltips yog opt-in rau kev ua tau zoo vim li cas, yog li koj yuav tsum pib lawv tus kheej .
- Cov lus qhia nrog xoom-ntev lub npe yeej tsis tshwm sim.
- Qhia
container: 'body'
kom tsis txhob muaj teeb meem nyob rau hauv cov khoom siv ntau dua (xws li peb cov tswv yim pab pawg, pawg khawm, thiab lwm yam). - Tig cov lus qhia ntawm cov ntsiab lus zais yuav tsis ua haujlwm.
- Cov lus qhia rau
.disabled
lossisdisabled
cov ntsiab lus yuav tsum tau ua rau ntawm cov khoom siv wrapper. - Thaum tshwm sim los ntawm hyperlinks uas hla ntau kab, cov lus qhia yuav yog qhov nruab nrab. Siv
white-space: nowrap;
koj<a>
tus kheej kom tsis txhob muaj tus cwj pwm no. - Cov lus qhia yuav tsum tau muab zais ua ntej lawv cov ntsiab lus sib raug tau raug tshem tawm ntawm DOM.
- Cov lus qhia tuaj yeem tshwm sim ua tsaug rau ib qho hauv ib qho duab ntxoov ntxoo DOM.
Tau txais tag nrho cov ntawd? Zoo heev, cia saib seb lawv ua haujlwm li cas nrog qee qhov piv txwv.
prefers-reduced-motion
lus nug xov xwm. Saib qhov
txo qis ntawm peb cov ntaub ntawv nkag mus tau .
Piv txwv
Qhib cov lus qhia
Raws li tau hais los saum no, koj yuav tsum pib pib cov lus qhia ua ntej lawv tuaj yeem siv tau. Ib txoj hauv kev los pib tag nrho cov lus qhia ntawm nplooj ntawv yuav yog xaiv lawv los ntawm lawv cov data-bs-toggle
cwj pwm, xws li:
const tooltipTriggerList = document.querySelectorAll('[data-bs-toggle="tooltip"]')
const tooltipList = [...tooltipTriggerList].map(tooltipTriggerEl => new bootstrap.Tooltip(tooltipTriggerEl))
Cov lus qhia ntawm qhov txuas
Hover tshaj qhov txuas hauv qab no kom pom cov lus qhia:
Placeholder text kom pom ib co inline links nrog tooltips. Qhov no yog tam sim no tsuas yog muab tub lim, tsis muaj killer. Cov ntsiab lus muab tso rau ntawm no tsuas yog ua kom pom cov ntawv nyeem tiag . Thiab txhua yam uas tsuas yog muab rau koj ib lub tswv yim ntawm yuav ua li cas cov lus qhia yuav zoo thaum siv hauv lub ntiaj teb tiag tiag. Yog li cia siab tias tam sim no koj tau pom yuav ua li cas cov lus qhia ntawm kev sib txuas tuaj yeem ua haujlwm hauv kev xyaum, thaum koj siv lawv ntawm koj tus kheej qhov chaw lossis qhov project.
<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
yog
data-bs-title
hauv koj li HTML. Thaum
title
siv, Popper yuav hloov nws nrog
data-bs-title
thaum lub caij ua tiav.
Cov lus qhia kev cai
Ntxiv hauv v5.2.0Koj tuaj yeem kho qhov pom ntawm cov lus qhia siv CSS hloov pauv . Peb tau teeb tsa chav kawm kev cai nrog data-bs-custom-class="custom-tooltip"
kom muaj peev xwm ua tau raws li peb qhov kev cai thiab siv nws los hla lub zos CSS kuj sib txawv.
.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>
Cov lus qhia
Hover dhau cov nyees khawm hauv qab no kom pom plaub lub tswv yim qhia: sab saum toj, sab xis, hauv qab, thiab sab laug. Cov lus qhia tau mirrored thaum siv Bootstrap hauv 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>
Thiab nrog kev cai HTML ntxiv:
<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>
Nrog SVG:
CSS
Hloov pauv
Ntxiv hauv v5.2.0Raws li ib feem ntawm Bootstrap's evolving CSS variables mus kom ze, tooltips tam sim no siv lub zos CSS variables .tooltip
rau txhim kho lub sij hawm customization. Cov txiaj ntsig rau CSS qhov sib txawv tau teeb tsa ntawm Sass, yog li Sass customization tseem txhawb nqa, ib yam nkaus.
--#{$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 variables
$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
Kev siv
Lub tooltip plugin tsim cov ntsiab lus thiab kos npe rau ntawm qhov kev thov, thiab los ntawm lub neej ntawd tso cov lus qhia tom qab lawv lub ntsiab lus.
Tig lub cuab yeej ntawm JavaScript:
const exampleEl = document.getElementById('example')
const tooltip = new bootstrap.Tooltip(exampleEl, options)
Hlawv auto
thiabscroll
Tooltip txoj hauj lwm sim hloov pauv thaum lub thawv niam txiv muaj lossis overflow: auto
nyiam overflow: scroll
peb .table-responsive
, tab sis tseem khaws cov thawj qhov chaw tso cai. Txhawm rau daws qhov no, teeb tsa qhov boundary
kev xaiv (rau qhov hloov pauv hloov pauv siv qhov popperConfig
kev xaiv) rau ib qho HTMLElement los hla tus nqi qub, 'clippingParents'
, xws li document.body
:
const tooltip = new bootstrap.Tooltip('#example', {
boundary: document.body // or document.querySelector('#boundary')
})
Markup
Qhov yuav tsum tau kos npe rau cov lus qhia tsuas yog tus data
cwj pwm thiab title
ntawm HTML lub caij koj xav kom muaj cov lus qhia. Lub generated markup ntawm ib tug tooltip yog qhov yooj yim, tab sis nws yuav tsum tau ib txoj hauj lwm (los ntawm lub neej ntawd, teem los top
ntawm lub plugin).
Ua cov lus qhia ua haujlwm rau cov keyboard thiab cov neeg siv thev naus laus zis
Koj tsuas yog yuav tsum ntxiv cov lus qhia rau HTML cov ntsiab lus uas yog ib txwm siv keyboard-focusable thiab sib tham sib (xws li kev sib txuas lossis daim ntawv tswj). Txawm hais tias cov ntsiab lus HTML arbitrary (xws li <span>
s) tuaj yeem ua kom pom tseeb los ntawm kev ntxiv tus tabindex="0"
cwj pwm, qhov no yuav ntxiv qhov ua rau muaj kev ntxhov siab thiab tsis meej pem tab nres ntawm cov ntsiab lus tsis sib cuam tshuam rau cov neeg siv keyboard, thiab feem ntau cov cuab yeej pab tam sim no tsis tshaj tawm cov lus qhia hauv qhov xwm txheej no. Tsis tas li ntawd, tsis txhob cia siab ib leeg los hover
ua qhov ua rau koj cov lus qhia, vim qhov no yuav ua rau koj cov lus qhia tsis tuaj yeem ua rau cov neeg siv cov keyboard.
<!-- 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>
Cov neeg xiam oob qhab
Cov ntsiab lus nrog tus disabled
cwj pwm tsis sib cuam tshuam, txhais tau tias cov neeg siv tsis tuaj yeem tsom, txav mus los, lossis nyem rau lawv kom ua rau cov lus qhia (lossis popover). Raws li kev daws teeb meem, koj yuav xav ua kom cov lus qhia los ntawm lub wrapper <div>
los yog <span>
, qhov zoo tshaj plaws ua keyboard-focusable siv 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>
Kev xaiv
Raws li kev xaiv tuaj yeem dhau los ntawm cov ntaub ntawv tus cwj pwm lossis JavaScript, koj tuaj yeem ntxiv ib qho kev xaiv npe rau data-bs-
, xws li hauv data-bs-animation="{value}"
. Nco ntsoov hloov cov ntaub ntawv ntawm lub npe xaiv los ntawm " camelCase " mus rau " kebab-case " thaum dhau cov kev xaiv ntawm cov ntaub ntawv cwj pwm. Piv txwv li, siv data-bs-custom-class="beautifier"
es tsis txhob data-bs-customClass="beautifier"
.
Raws li ntawm Bootstrap 5.2.0, tag nrho cov khoom txhawb nqa qhov kev sim khaws tseg cov ntaub ntawv tus cwj pwm data-bs-config
uas tuaj yeem ua tsev yooj yim kev teeb tsa raws li JSON txoj hlua. Thaum ib qho khoom muaj data-bs-config='{"delay":0, "title":123}'
thiab data-bs-title="456"
tus cwj pwm, tus title
nqi kawg yuav yog 456
thiab cov ntaub ntawv sib cais yuav dhau los ntawm cov txiaj ntsig tau muab rau data-bs-config
. Ntxiv mus, cov ntaub ntawv uas twb muaj lawm muaj peev xwm ua tsev JSON qhov tseem ceeb xws li data-bs-delay='{"show":0,"hide":150}'
.
sanitize
,
sanitizeFn
, thiab
allowList
cov kev xaiv tsis tuaj yeem muab siv cov ntaub ntawv tus cwj pwm.
Lub npe | Hom | Default | Kev piav qhia |
---|---|---|---|
allowList |
khoom | Default tus nqi | Yam khoom uas muaj cov cwj pwm tso cai thiab cov cim npe. |
animation |
boolean | true |
Siv CSS hloov pauv mus rau cov lus qhia. |
boundary |
hlua, element | 'clippingParents' |
Overflow txwv ciam teb ntawm cov lus qhia (tsuas yog siv rau Popper's PreventOverflow modifier). Los ntawm lub neej ntawd, nws yog 'clippingParents' thiab tuaj yeem lees txais HTMLElement siv (ntawm JavaScript nkaus xwb). Yog xav paub ntxiv mus saib Popper's detectOverflow docs . |
container |
txoj hlua, element, cuav | false |
Appends lub tooltip rau ib lub caij tshwj xeeb. container: 'body' Piv txwv :. Qhov kev xaiv no muaj txiaj ntsig tshwj xeeb hauv qhov uas nws tso cai rau koj los tso cov lus qhia hauv qhov ntws ntawm cov ntaub ntawv nyob ze ntawm lub ntsiab lus tshwm sim - uas yuav tiv thaiv cov cuab yeej los ntawm ntab tawm ntawm qhov cuam tshuam thaum lub qhov rais hloov pauv. |
customClass |
txoj hlua, ua haujlwm | '' |
Ntxiv cov chav kawm rau cov lus qhia thaum nws pom. Nco ntsoov tias cov chav kawm no yuav muab ntxiv ntxiv rau cov chav kawm uas tau teev tseg hauv cov qauv. Txhawm rau ntxiv ntau chav kawm, cais lawv nrog qhov chaw: 'class-1 class-2' . Koj tuaj yeem dhau ib txoj haujlwm uas yuav tsum rov qab ib txoj hlua uas muaj cov npe hauv chav kawm ntxiv. |
delay |
tus lej, yam khoom | 0 |
Ncua sijhawm qhia thiab zais cov lus qhia (ms) - tsis siv rau phau ntawv txhais hom. Yog tias muaj tus lej nkag, ncua sijhawm yog siv rau ob qho tib si zais / qhia. Yam khoom qauv yog: delay: { "show": 500, "hide": 100 } . |
fallbackPlacements |
array | ['top', 'right', 'bottom', 'left'] |
Txheeb xyuas qhov chaw rov qab los ntawm kev muab cov npe ntawm qhov chaw nyob hauv array (hauv kev txiav txim siab). Yog xav paub ntxiv mus saib Popper tus cwj pwm docs . |
html |
boolean | false |
Tso cai HTML hauv cov lus qhia. Yog tias muaj tseeb, HTML cim npe hauv cov lus qhia title yuav raug muab tso rau hauv cov lus qhia. Yog tias tsis tseeb, innerText cov cuab yeej yuav raug siv los ntxig cov ntsiab lus rau hauv DOM. Siv cov ntawv nyeem yog tias koj txhawj xeeb txog XSS tawm tsam. |
offset |
array, hlua, function | [0, 0] |
Offset ntawm tooltip txheeb ze rau nws lub hom phiaj. Koj tuaj yeem hla ib txoj hlua hauv cov ntaub ntawv tus cwj pwm nrog comma cais qhov tseem ceeb xws li: data-bs-offset="10,20" . Thaum muaj nuj nqi yog siv los txiav txim qhov offset, nws raug hu nrog ib yam khoom uas muaj cov popper qhov chaw, siv, thiab popper rects raws li nws thawj qhov kev sib cav. Lub triggering element DOM node tau dhau los ua qhov kev sib cav thib ob. Txoj haujlwm yuav tsum rov qab ib qho array nrog ob tus lej: skidding , nrug . Yog xav paub ntxiv mus saib Popper's offset docs . |
placement |
txoj hlua, ua haujlwm | 'top' |
Yuav ua li cas tso lub cuab yeej: pib, sab saum toj, hauv qab, sab laug, sab xis. Thaum auto tau teev tseg, nws yuav dynamically reorient lub tooltip. Thaum muaj nuj nqi yog siv los txiav txim qhov kev tso kawm, nws raug hu nrog lub tooltip DOM node raws li nws thawj qhov kev sib cav thiab lub triggering ntsiab DOM node raws li nws thib ob. Cov this ntsiab lus tau teeb tsa rau qhov piv txwv tooltip. |
popperConfig |
null, object, function | null |
Txhawm rau hloov Bootstrap's default Popper config, saib Popper's configuration . Thaum muaj nuj nqi siv los tsim Popper configuration, nws tau hu nrog ib yam khoom uas muaj Bootstrap lub neej ntawd Popper configuration. Nws pab koj siv thiab ua ke lub neej ntawd nrog koj tus kheej configuration. Cov haujlwm yuav tsum xa rov qab cov khoom teeb tsa rau Popper. |
sanitize |
boolean | true |
Qhib lossis kaw qhov kev huv huv. Yog tias qhib 'template' , 'content' thiab 'title' cov kev xaiv yuav raug ntxuav. |
sanitizeFn |
null, ua | null |
Ntawm no koj tuaj yeem muab koj tus kheej ua haujlwm huv. Qhov no tuaj yeem pab tau yog tias koj xav siv lub tsev qiv ntawv tshwj xeeb los ua kom huv. |
selector |
txoj hlua, cuav | false |
Yog hais tias muaj ib tug selector, tooltip khoom yuav delegated mus rau lub hom phiaj teev. Hauv kev xyaum, qhov no yog siv los kuj siv cov lus qhia rau dynamically ntxiv DOM ntsiab ( jQuery.on kev txhawb nqa). Saib qhov teeb meem no thiab ib qho piv txwv qhia . |
template |
txoj hlua | '<div class="tooltip" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>' |
Base HTML siv thaum tsim cov lus qhia. Cov cuab yeej cuab tam title yuav raug txhaj rau hauv .tooltip-inner . .tooltip-arrow yuav ua tus tooltip xub xub. Cov txheej txheem wrapper sab nraud yuav tsum muaj cov .tooltip chav kawm thiab role="tooltip" . |
title |
txoj hlua, element, function | '' |
Default title value yog title attribute tsis nyob. Yog tias muaj nuj nqi tau muab, nws yuav raug hu nrog nws cov this ntaub ntawv teev rau lub caij uas lub popover txuas nrog. |
trigger |
txoj hlua | 'hover focus' |
Yuav ua li cas cov lus qhia yog triggered: nyem, hover, tsom, phau ntawv. Koj tuaj yeem hla ntau qhov ua rau; cais lawv nrog ib qho chaw. 'manual' qhia tau hais tias cov lus qhia yuav tau ua rau programmatically ntawm cov .tooltip('show') , .tooltip('hide') thiab .tooltip('toggle') cov txheej txheem; tus nqi no tsis tuaj yeem ua ke nrog lwm qhov kev cuam tshuam. 'hover' ntawm nws tus kheej yuav ua rau cov lus qhia uas tsis tuaj yeem tshwm sim ntawm cov keyboard, thiab tsuas yog yuav tsum tau siv yog tias lwm txoj hauv kev rau kev xa cov ntaub ntawv tib yam rau cov neeg siv keyboard tam sim no. |
Cov ntaub ntawv tus cwj pwm rau tus kheej cov lus qhia
Cov kev xaiv rau tus kheej cov lus qhia tuaj yeem hloov pauv tau los ntawm kev siv cov ntaub ntawv cwj pwm, raws li tau piav qhia saum toj no.
Siv ua haujlwm nrogpopperConfig
const tooltip = new bootstrap.Tooltip(element, {
popperConfig(defaultBsPopperConfig) {
// const newPopperConfig = {...}
// use defaultBsPopperConfig if needed...
// return newPopperConfig
}
})
Cov txheej txheem
Asynchronous txoj kev thiab kev hloov
Txhua txoj kev API yog asynchronous thiab pib hloov pauv . Lawv rov qab mus rau tus neeg hu xov tooj sai li sai tau thaum qhov kev hloov pauv pib tab sis ua ntej nws xaus . Tsis tas li ntawd, ib txoj kev hu rau ib qho kev hloov pauv yuav raug tsis quav ntsej .
Txoj kev | Kev piav qhia |
---|---|
disable |
Tshem tawm lub peev xwm rau lub ntsiab lus qhia kom pom. Cov lus qhia yuav tsuas tuaj yeem pom yog tias nws rov qhib dua. |
dispose |
Nkaum thiab rhuav tshem cov ntsiab lus cov cuab yeej (Tshem tawm cov ntaub ntawv khaws cia ntawm DOM lub caij). Cov lus qhia uas siv delegation (uas yog tsim los ntawm selector kev xaiv ) tsis tuaj yeem raug rhuav tshem ib tus zuj zus ntawm cov xeeb leej xeeb ntxwv. |
enable |
Muab ib lub ntsiab lus qhia lub peev xwm los qhia. Cov lus qhia tau qhib los ntawm lub neej ntawd. |
getInstance |
Txoj kev zoo li qub uas tso cai rau koj kom tau txais cov lus qhia piv txwv cuam tshuam nrog DOM lub caij, lossis tsim ib qho tshiab yog tias nws tsis tau pib. |
getOrCreateInstance |
Txoj kev zoo li qub uas tso cai rau koj kom tau txais cov lus qhia piv txwv cuam tshuam nrog DOM lub caij, lossis tsim ib qho tshiab yog tias nws tsis tau pib. |
hide |
Hide ib lub ntsiab lus qhia. Rov qab mus rau tus neeg hu ua ntej cov lus qhia tau muab zais tiag tiag (piv txwv li ua ntej qhov hidden.bs.tooltip xwm txheej tshwm sim). Qhov no suav hais tias yog "kev tuav tes" ua rau cov lus qhia. |
setContent |
Muab ib txoj hauv kev los hloov cov lus qhia cov ntsiab lus tom qab nws pib. |
show |
Qhia ib lub ntsiab lus qhia. Rov qab mus rau tus neeg hu ua ntej cov lus qhia tau tshwm sim tiag tiag (piv txwv li ua ntej qhov shown.bs.tooltip xwm txheej tshwm sim). Qhov no suav hais tias yog "kev tuav tes" ua rau cov lus qhia. Cov lus qhia nrog xoom-ntev lub npe yeej tsis tshwm sim. |
toggle |
Toggles ib lub ntsiab lus qhia. Rov qab mus rau tus neeg hu ua ntej cov lus qhia tau tshwm sim los yog muab zais (piv txwv li ua ntej qhov shown.bs.tooltip kev hidden.bs.tooltip tshwm sim tshwm sim). Qhov no suav hais tias yog "kev tuav tes" ua rau cov lus qhia. |
toggleEnabled |
Toggles lub peev xwm rau lub ntsiab lus qhia kom pom lossis zais. |
update |
Hloov kho txoj haujlwm ntawm lub ntsiab lus qhia. |
const tooltip = bootstrap.Tooltip.getInstance('#example') // Returns a Bootstrap tooltip instance
// setContent example
tooltip.setContent({ '.tooltip-inner': 'another title' })
setContent
kev lees txais qhov kev
object
sib cav, qhov twg txhua lub cuab yeej-tus yuam sij yog tus
string
xaiv siv tau nyob rau hauv cov qauv popover, thiab txhua yam khoom muaj nqis tuaj yeem ua tau
string
|
element
|
function
|
null
Cov xwm txheej
Kev tshwm sim | Kev piav qhia |
---|---|
hide.bs.tooltip |
Qhov xwm txheej no raug rho tawm haujlwm tam sim ntawd thaum hide hu ua piv txwv txoj kev. |
hidden.bs.tooltip |
Qhov kev tshwm sim no raug rho tawm haujlwm thaum lub popover tiav lawm muab zais los ntawm tus neeg siv (yuav tos rau CSS kev hloov pauv kom tiav). |
inserted.bs.tooltip |
Qhov kev tshwm sim no raug rho tawm haujlwm tom qab qhov show.bs.tooltip tshwm sim thaum lub cuab yeej template tau ntxiv rau DOM. |
show.bs.tooltip |
Qhov xwm txheej no tua hluav taws tam sim ntawd thaum show hu ua piv txwv. |
shown.bs.tooltip |
Qhov kev tshwm sim no raug rho tawm haujlwm thaum lub popover tau pom rau tus neeg siv (yuav tos rau CSS kev hloov pauv kom tiav). |
const myTooltipEl = document.getElementById('myTooltip')
const tooltip = bootstrap.Tooltip.getOrCreateInstance(myTooltipEl)
myTooltipEl.addEventListener('hidden.bs.tooltip', () => {
// do something...
})
tooltip.hide()