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.
Fɛn minnu ka kan ka dɔn ni i bɛ baara kɛ ni popover plugin ye:
- Popovers bɛ u jigi da 3nan ka bibliothèque Popper.js kan jɔyɔrɔko la. Aw ka kan ka popper.min.js don a kɔnɔ ka kɔn bootstrap.js ɲɛ walima ka baara kɛ ni
bootstrap.bundle.min.js
/bootstrap.bundle.js
ye min kɔnɔ Popper.js bɛ yen walasa popovers ka baara kɛ! - Popovers bɛ tooltip plugin de wajibiya i n’a fɔ dependency.
- N'i bɛ an ka JavaScript jɔ ka bɔ source la, a bɛ wajibiya
util.js
. - Popovers ye opt-in ye baarakɛcogo kunw na, o la aw yɛrɛ ka kan k’u daminɛ .
- Zero-janya
title
nicontent
nafaw 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
.disabled
walimadisabled
elements 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
white-space: nowrap;
bɛ 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ɔ.
Aw bɛ to ka kalan kɛ walasa ka a dɔn popoverw bɛ baara kɛ cogo min na ni misali dɔw ye.
Popoverw bɛɛ daminɛcogo dɔ ɲɛ dɔ kan o ye k’u sugandi u ka data-toggle
fɛnɲɛnɛma fɛ:
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 container
walasa popover ka HTML ka Bɔ o element ‘kɔnɔ o nɔ na.
<button type="button" class="btn btn-lg btn-danger" data-toggle="popover" title="Popover title" data-content="And here's some amazing content. It's very engaging. Right?">Click to toggle popover</button>
Sugandili naani bɛ yen: sanfɛ, kinin fɛ, duguma ani numan fɛ.
Baara kɛ ni focus
trigger 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 tabindex
attribut dɔ don a kɔnɔ.
<a tabindex="0" class="btn btn-lg btn-danger" role="button" data-toggle="popover" data-trigger="focus" title="Dismissible popover" data-content="And here's some amazing content. It's very engaging. Right?">Dismissible popover</a>
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 la <div>
walima <span>
ka override the pointer-events
on disabled element.
Popover triggers disabled (popover triggers) la, i bɛ se fana k’a fɛ data-trigger="hover"
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.
<span class="d-inline-block" data-toggle="popover" data-content="Disabled popover">
<button class="btn btn-primary" style="pointer-events: none;" type="button" disabled>Disabled button</button>
</span>
Popovers baara kɛ JavaScript fɛ:
Sugandili bɛ se ka tɛmɛ data attributes walima JavaScript fɛ. Donanw cogoyaw kama, aw bɛ sugandi tɔgɔ fara data-
, i n’a fɔ a bɛ cogo min na data-animation=""
.
Tɔ̀gɔ | Ka sɛbɛen masin na | Fɔlɔ | Cogojirali |
---|---|---|---|
animation (ɲɛnamaya kɛcogo ɲuman). | boolean ye | sɛbɛ | CSS fade transition dɔ kɛ ka popover kɛ |
minɛn kɔnɔ | juru | element | nkalon | nkalon | A bɛ popover fara fɛn kɛrɛnkɛrɛnnen dɔ kan. Misali la: |
kɔnɔnafɛn | juru | element | baarakunda | '' '' . | Kɔnɔkow nafa dafalen ni Ni baara dɔ dira, a bɛ Weele n'a ka |
ka mɛ | jate | minɛn | 0 ye | Delay jirali ni a dogo popover (ms) - 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: |
html ye | boolean ye | nkalon | HTML don popover kɔnɔ. Ni nkalon don, jQuery ka text fɛɛrɛ 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. |
bilali sen kan | juru | baarakunda | 'jo' | Cogo min na ka popover bila - auto | sanfɛ | duguma | kinin fɛ | jo. 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 |
sugandilikɛla | juru | nkalon | nkalon | Ni sugandili dɔ dira, popover fɛnw bɛna di laɲini kofɔlenw ma. Tiɲɛ na, o bɛ Kɛ walasa ka HTML kɔnɔkow dinamikilenw Dɛmɛ ka popovers (popovers) Fàra u kan. Aw ye nin lajɛ ani misali min bɛ kunnafoni di . |
jatebɔlan | gaari | '<div class="popover" role="tooltip"><div class="arrow"></div><h3 class="popover-header"></h3><div class="popover-body"></div></div>' |
Base HTML ka baara kɛ ni popover dabɔli ye. Popover's Popover's
Kɛnɛma-datugulan yɔrɔ ka kan ka kɛ ni |
titiri | juru | element | baarakunda | '' '' . | Title nafa dafalen ni Ni baara dɔ dira, a bɛ Weele n'a ka |
ka ci | gaari | 'kliki' ye. | Popover bɛ daminɛ cogo min na - i ka | hover | sinsinnan | min bɛ fɛn bolo la. Aw bɛ se ka tɛmɛ fɛn caman kan minnu bɛ se ka kɛ sababu ye; u faranfasi ni yɔrɔ ye. `manuel` tɛ se ka fara ɲɔgɔn kan ni trigger wɛrɛ ye. |
offset (fɔcogo ɲuman). | jate | gaari | 0 ye | Offset ka popover ka kɛɲɛ n’a ka laɲini ye. Walasa ka kunnafoni wɛrɛw sɔrɔ, aw ye Popper.js ka offset docs lajɛ . |
fallbackBɔli | juru | array (ɲɛnajɛ). | 'kilape' | A to k’a jira Popper bɛna baara kɛ ni jɔyɔrɔ min ye fallback kan. Walasa ka kunnafoni wɛrɛw sɔrɔ, aw ye Popper.js ka kɛwale sɛbɛnw lajɛ |
dankan | juru | fɛn | 'sɛbɛnni Bangebagaw'. | Overflow constraint dancɛ ka popover. A bɛ Sɔn 'viewport' , 'window' , 'scrollParent' , walima HTMLElement ɲɛfɔli dɔ nafaw ma (JavaScript dɔrɔn). Walasa ka kunnafoni wɛrɛw sɔrɔ, aw ye Popper.js ka preventOverflow docs lajɛ . |
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ɛ.
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ɔ.
A bɛ popovers daminɛ ka ɲɛsin element collection dɔ ma.
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.popover
in 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.
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.popover
in ka Kɛ). O bɛ jate “bolola” ye min bɛ popover (popover) daminɛ.
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.popover
walima hidden.bs.popover
ko kɛlen ka kɛ). O bɛ jate “bolola” ye min bɛ popover (popover) daminɛ.
A bɛ element dɔ ka popover dogo ani k’a tiɲɛ. Popovers minnu bɛ baara Kɛ ni delegation ye (minnu bɛ Dabɔ ni option selector
ye ) tɛ Se ka Tiɲɛ kelen-kelen na descendant trigger elements kan.
A bɛ element dɔ ka popover seko jira ka jira. Popovers bɛ baara kɛ ni default ye.
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.
A bɛ se ka fɛn dɔ ka popover jira walima ka dogo.
A bɛ element dɔ ka popover jɔyɔrɔ kura.
Ko kɛlen suguya | Cogojirali |
---|---|
jira.bs.popover ye | O ko in bɛ tasuma Bɔ o yɔrɔnin bɛɛ ni show misali fɛɛrɛ Weelera. |
jirala.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). |
dogo.bs.popover ye | O ko in bɛ Fɔ o yɔrɔnin bɛɛ ni hide misali fɛɛrɛ Weelera. |
dogolen.bs.faantanw | O ko in bɛ Bɔ ni popover dogolen Banna baarakɛla fɛ (a bɛna CSS 'tɛmɛsiraw makɔnɔ u ka ban). |
donna.bs.faantanw | O ko in bɛ Bɔ kɛnɛ kan ko kɛlen kɔfɛ show.bs.popover ni popover template farala DOM kan. |