Bapopovers
Mikanda mpe bandakisa mpo na kobakisa ba popovers ya Bootstrap, lokola oyo ezwami na iOS, na élément nyonso na site na yo.
Botali ya mozindo
Makambo oyo osengeli koyeba ntango ozali kosalela plugin ya popover:
- Popovers ba se fier na bibliothèque ya 3ème partie Popper.js pona positionnement. Esengeli otia popper.min.js liboso ya bootstrap.js to osalela
bootstrap.bundle.min.js
/bootstrap.bundle.js
oyo ezali na Popper.js mpo ba popovers esalaka! - Popovers esengaka plugin ya tooltip lokola dépendance.
- Soki ozali kotonga JavaScript na biso uta na source, esengi
util.js
. - Popovers ezali opt-in mpo na ba raisons ya performance, yango wana esengeli o initialiser yango yo moko .
- Zéro-longueur
title
na bacontent
valeurs eko lakisa jamais popover. - Boyebisa
container: 'body'
pona ko éviter ba problèmes ya rendu na ba composants plus complexes (lokola ba groupes na biso ya entrée, ba groupes ya boutons, etc). - Ko déclencher ba popovers na ba éléments cachés ekosimba te.
- Popovers mpo na
.disabled
todisabled
ba éléments esengeli e déclenché na élément ya enveloppe. - Ntango ebandisami uta na ba ancres oyo ezingami na milɔngɔ mingi, ba popovers ekozala na katikati kati na bonene mobimba ya ba ancres. Salelá
.text-nowrap
na s na yo<a>
mpo na koboya ezaleli oyo. - Esengeli kobomba ba popovers avant ba éléments correspondants na yango elongolama na DOM.
- Popovers ekoki ko déclenché grâce na élément moko na kati ya DOM ya ombre.
Effet ya animation ya composante oyo ezali dépendant na prefers-reduced-motion
requête ya média. Tala eteni ya mouvement réduit ya mikanda na biso ya accessibilité .
Koba kotanga mpo na komona ndenge nini ba popovers esalaka na mwa bandakisa.
Ndakisa: Kofungola ba popovers bisika nyonso
Lolenge moko ya ko initialiser ba popovers nionso na page moko ekozala pona yango na data-toggle
attribut na yango:
Ndakisa: Kosalela container
option
Ntango ozali na mwa ba styles na élément parent oyo e interférer na popover, okolinga ko préciser personnalisé container
mpo HTML ya popover ebima na kati ya élément wana na esika na yango.
Ndakisa
Ba direction minei
Ba options minei ezali: likolo, na loboko ya mobali, na nse, mpe na loboko ya mwasi.
Bolongola na clic oyo elandi
Salelá focus
déclencheur mpo na koboya ba popovers na clic oyo elandi ya mosaleli ya élément ekeseni na élément ya kobalusa.
Marquage spécifique esengeli mpo na dismiss-on-next-click
Mpo na bizaleli malamu ya croix-navigateur mpe cross-plateforme, osengeli kosalela <a>
tag, kasi tag te <button>
, mpe osengeli mpe kotya tabindex
attribut.
Ba éléments oyo ekangami
Ba éléments oyo ezali na disabled
attribut ezali interactif te, elingi koloba ba usagers bakoki te ko hover to ko cliquer yango pona ko déclencher popover (to tooltip). Lokola solution, okolinga ko déclencher popover à partir ya enveloppe <div>
to <span>
pe ko override the pointer-events
na élément désactivé.
Mpo na ba déclencheur ya popover oyo ekangami, okoki mpe kolinga data-trigger="hover"
mpo ete popover ebima lokola makanisi ya komona ya mbala moko na basaleli na yo lokola bakoki kozela te kofina na eleman oyo ekangami.
Kosalela yango
Bofungola ba popovers na nzela ya JavaScript:
Makambo oyo okoki kopona
Ba options ekoki koleka na nzela ya ba attributs ya ba données to JavaScript. Mpo na ba attributs ya ba données, bakisa kombo ya option na data-
, lokola na data-animation=""
.
Nkombo | Lolenge | Mbeba | Ndimbola |
---|---|---|---|
animation ya kosala | boolean | ya solo | Salelá transition ya fade ya CSS na popover |
eloko oyo batyaka na kati | molongo ya molongo | élément | lokuta | lokuta | Ebakisi popover na élément moko ya sikisiki. Ndakisa: |
makambo eza na kati | molongo ya molongo | élément | mosala | '' . | Valeur ya contenus par défaut soki Soki fonction moko epesami, ekobenga yango na |
kozelisa | motango | moto ya likambo | 0. | Retard ya kolakisa pe kobomba popover (ms) - etali te type ya déclencheur manuel Soki nimero moko epesami, retard esalemi na nyonso mibale kobomba/lakisa Bokeli ya eloko ezali: |
html | boolean | lokuta | Kotisa HTML na kati ya popover. Soki ezali lokuta, méthode ya jQuery text ekosalelama mpo na kokotisa makambo na DOM. Salelá makomi soki ozali komitungisa mpo na ba attaques ya XSS. |
esika ya kotya yango | molongo ya molongo | mosala | 'malamu' | Ndenge nini ko positionner popover - auto | likolo ya likolo | na nse | na gauche | malamu. Tango fonction esalelami pona koyeba placement, ebengami na node popover DOM lokola argument na yango ya liboso pe élément déclencheur node DOM lokola ya mibale na yango. Contexte |
moponi | molongo ya molongo | lokuta | lokuta | Soki moponi epesami, biloko ya popover ekopesama na ba cibles oyo elakisami. Na pratique, yango esalelamaka pona ko permettre ba contenus HTML dynamiques ezala na ba popovers oyo ebakisami. Talá oyo mpe ndakisa moko oyo ezali kopesa makambo mingi . |
modèle ya kosala | shene | '<div class="popover" role="tooltip"><div class="arrow"></div><h3 class="popover-header"></h3><div class="popover-body"></div></div>' |
Base HTML ya kosalela tango ya kosala popover. Ba popover's Ba popover's
Elemento ya enveloppe ya libanda esengeli kozala na |
titre | molongo ya molongo | élément | mosala | '' . | Valeur ya titre par défaut soki Soki fonction moko epesami, ekobenga yango na |
kobandisa | shene | 'cliquez'. | Ndenge nini popover ebandi - finá | kosala hover | focus | mokanda. Okoki koleka ba déclencheur ebele; kokabola bango na esika moko. manual ekoki kosangisama te na déclencheur mosusu. |
offset ya kosala | motango | shene | 0. | Offset ya popover par rapport na cible na yango. Mpo na koyeba makambo mingi tala Docs ya offset ya Popper.js . |
fallbackKotia na esika na yango | molongo ya molongo | array ya biloko | 'kobalusa' | Tika kolakisa position nini Popper akosalela na fallback. Mpo na koyeba makambo mingi tala mikanda ya bizaleli ya Popper.js |
ndelo ya mboka | molongo ya molongo | eloko | 'moboti ya défilement'. | Débordement contrainte frontière ya popover. Endimi motuya ya 'viewport' , 'window' , 'scrollParent' , to référence ya HTMLElement (JavaScript kaka). Mpo na koyeba makambo mingi tala ba docs ya preventOverflow ya Popper.js . |
Ba attributs ya ba données pona ba popovers moko moko
Ba options pona ba popovers moko moko ekoki na ndenge mosusu kozala précisé na nzela ya bosaleli ba attributs ya ba données, ndenge elimbolami likolo.
Ba méthodes ya kosala
Ba méthodes asynchrones na ba transitions
Ba méthodes nionso ya API ezali asynchrone mpe ebandi transition . Bazongaka epai ya moto oyo abengi ntango kaka mbongwana ebandi kasi liboso ete esila . En plus, appel ya méthode na composante ya transition ekozala ignorée .
Tala mikanda na biso ya JavaScript mpo na koyeba makambo mosusu .
$().popover(options)
Initialise ba popovers pona collection ya élément.
.popover('show')
Ezali kobimisa popover ya élément moko. Ezongi na mobengi yambo popover elakisama mpenza (elingi koloba liboso ete shown.bs.popover
likambo esalema). Yango etalelami lokola “manuel” oyo ebandisaka popover. Ba Popovers oyo titre na yango na contenus na yango ezali na bolai ya zéro elakisami jamais.
.popover('hide')
Ebombaka popover ya élément moko. Ezongi na mobengi yambo ete popover ebombama mpenza (elingi koloba liboso ete hidden.bs.popover
likambo esalema). Yango etalelami lokola “manuel” oyo ebandisaka popover.
.popover('toggle')
Toggles popover ya élément moko. Ezongi na mobengi yambo popover elakisama to ebombama mpenza (elingi koloba liboso ete likambo shown.bs.popover
to hidden.bs.popover
esalema). Yango etalelami lokola “manuel” oyo ebandisaka popover.
.popover('dispose')
Ebombaka mpe ebebisaka popover ya élément moko. Ba popovers oyo esalela délégation (oyo esalemi na nzela ya selector
option ) ekoki kobebisama moko moko te na ba éléments déclencheur descendant.
.popover('enable')
Epesaka popover ya élément moko makoki ya kolakisa. Popovers ezali activé par défaut.
.popover('disable')
Elongolaka makoki mpo na popover ya élément moko elakisama. Popover ekozala na makoki ya kolakisa kaka soki ezongisami na mosala.
.popover('toggleEnabled')
Toggles makoki mpo na popover ya element moko elakisama to ebombama.
.popover('update')
Mikolo oyo position ya popover ya élément moko.
Makambo oyo esalemaki
Lolenge ya likambo | Ndimbola |
---|---|
elakisaka.bs.popover | Evenement oyo ezo beta mbala moko tango show méthode ya instance ebengami. |
elakisami.bs.bobola | Evenement oyo ezo beta tango popover esalemi visible na mosaleli (ekozela ba transitions ya CSS esila). |
bomba.bs.bobola | Evenement oyo ezo beta mbala moko tango hide méthode ya instance ebengami. |
ebombami.bs.bobola | Evenement oyo ezo beta tango popover esili kobombama na mosaleli (ekozela ba transitions ya CSS esila). |
ekotisami.bs.bobola | Evenement oyo ezo bengana sima ya show.bs.popover événement tango modèle ya popover ebakisami na DOM. |