Popovers
Akwụkwọ na ihe atụ maka ịgbakwunye popovers Bootstrap, dị ka ndị ahụ dị na iOS, na mmewere ọ bụla na saịtị gị.
Ihe ị ga-ama mgbe ị na-eji ngwa mgbakwunye popover:
- Popovers na-adabere na ọba akwụkwọ ndị otu nke atọ Popper.js maka itinye ya. Ị ga-agụnye popper.min.js tupu bootstrap.js ma ọ bụ jiri
bootstrap.bundle.min.js
/bootstrap.bundle.js
nke nwere Popper.js ka popovers rụọ ọrụ! - Popovers chọrọ ngwa mgbakwunye ngwaọrụ dị ka ndabere.
- Ọ bụrụ na ị na-ewu Javascript anyị site na isi iyi, ọ chọrọ
util.js
. - Popovers abanyela maka ebumnuche arụmọrụ, yabụ ị ga-ebido ya n'onwe gị .
- Ogologo efu
title
nacontent
ụkpụrụ agaghị egosi popover. - Ezipụta
container: 'body'
ka ịzenarị nsogbu n'ime ihe ndị dị mgbagwoju anya (dị ka otu ntinye anyị, otu bọtịnụ, wdg). - Ịkpalite popovers na ihe zoro ezo agaghị arụ ọrụ.
- Popovers maka
.disabled
ma ọ bụdisabled
ọcha ga-akpalite na ihe mkpuchi. - Mgbe a kpalitere site na arịlịka nke kechie n'ofe ahịrị dị iche iche, popovers ga-adị n'etiti obosara nke arịlịka n'ozuzu ya. Jiri
white-space: nowrap;
na<a>
s gị zere omume a. - A ghaghị izobe ihe ndị na-ebupụta ihe tupu e wepụ ihe ndị kwekọrọ na DOM.
Nọgide na-agụ ka ịhụ ka popovers si arụ ọrụ na atụ ụfọdụ.
Otu ụzọ isi bido popovers niile na ibe ga-abụ ịhọrọ ha site na data-toggle
njirimara ha:
Mgbe ị nwere ụdị ụfọdụ na mmewere nne na nna na-egbochi popover, ị ga-achọ ịkọwapụta omenala container
ka HTML popover wee pụta n'ime mmewere ahụ kama.
<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>
Nhọrọ anọ dị: n'elu, aka nri, ala na aka ekpe kwadoro.
Jiri focus
mkpalite chụpụ popovers na ọpịpị ọzọ onye ọrụ nke ihe dị iche karịa mmewere mgbanwe.
Akara akara akọwapụtara achọrọ maka ịchụpụ-na-esote-pịa
Maka ezigbo ihe nchọgharị na omume cross-platform, ị ga-eji <a>
mkpado, ọ bụghị mkpado <button>
, na ị ga-etinyerịrị tabindex
àgwà.
<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>
Ihe ndị nwere disabled
njirimara ahụ anaghị emekọrịta ihe, nke pụtara na ndị ọrụ enweghị ike ịnyagharị ma ọ bụ pịa ha ka ha kpalite popover (ma ọ bụ Tooltip). Dị ka ihe na-arụ ọrụ, ị ga-achọ ịkpalite popover site na ihe mkpuchi <div>
ma ọ bụ <span>
kagbuo ihe pointer-events
ahụ nwere nkwarụ.
Maka ihe mkpalite popover nwere nkwarụ, ị nwekwara ike ịhọrọ data-trigger="hover"
ka popover pụta dị ka nzaghachi anya ozugbo nye ndị ọrụ gị ka ha nwere ike ọ gaghị atụ anya ịpị ihe nwere nkwarụ.
<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>
Kwado popovers site na Javascript:
Enwere ike ịfefe nhọrọ site na njirimara data ma ọ bụ Javascript. Maka njirimara data, tinye aha nhọrọ na data-
, dị ka ọ dị na data-animation=""
.
Aha | Ụdị | Ọdabara | Nkọwa |
---|---|---|---|
animation | boolean | eziokwu | Tinye mgbanwe mgbanwe CSS na popover |
akpa | eriri | mmewere | ụgha | ụgha | Na-agbakwunye popover na otu mmewere. Ọmụmaatụ |
ọdịnaya | eriri | mmewere | ọrụ | '' | Uru ọdịnaya ezighi ezi ma ọ bụrụ Ọ bụrụ na enyere ọrụ, a ga-akpọ ya na |
igbu oge | nọmba | ihe | 0 | Ngosipụta na izobe popover (ms) - anaghị emetụta ụdị mkpalite aka Ọ bụrụ na ewepụtara nọmba, a na-etinye igbu oge na ma zoo/egosi Nhazi ihe bụ: |
html | boolean | ụgha | Fanye HTML n'ime popover. Ọ bụrụ ụgha, text a ga-eji usoro jQuery tinye ọdịnaya n'ime DOM. Jiri ederede ma ọ bụrụ na ị na-echegbu onwe gị maka mwakpo XSS. |
ntinye | eriri | ọrụ | 'ziri ezi' | Otu esi edobe popover - akpaaka | n'elu | ala | aka ekpe | nri. Mgbe a na-eji ọrụ iji chọpụta ntinye, a na-akpọ ya na popover DOM node dị ka arụmụka mbụ ya na ihe na-akpali akpali DOM node dị ka nke abụọ ya. Edebere |
onye nhọpụta | eriri | ụgha | ụgha | Ọ bụrụ na enyere onye nhọpụta, a ga-ekenyefe ihe popover na ebumnuche ndị akọwapụtara. Na omume, a na-eji nke a mee ka ọdịnaya HTML dị ike ka agbakwunyere popovers. Hụ nke a na ihe atụ na-enye nkọwa . |
ndebiri | eriri | '<div class="popover" role="tooltip"><div class="arrow"></div><h3 class="popover-header"></h3><div class="popover-body"></div></div>' |
Ntọala HTML iji mee ihe mgbe ị na-emepụta popover. A A
Ihe mkpuchi nke dị n'elu kwesịrị inwe |
aha | eriri | mmewere | ọrụ | '' | Uru aha ndabara ma ọ bụrụ Ọ bụrụ na enyere ọrụ, a ga-akpọ ya na |
ịkpalite | eriri | 'pịa' | Kedu ka esi eme popover - pịa | hover | lekwasịrị anya | akwụkwọ ntuziaka. Ị nwere ike ịgafe ọtụtụ ihe mkpali; kewaa ha na oghere. Enweghị ike ijikọ 'akwụkwọ ntuziaka' na mkpalite ọ bụla ọzọ. |
nkwụsị | nọmba | eriri | 0 | Mwepu nke popover n'ihe metụtara ebumnuche ya. Maka ozi ndị ọzọ rụtụ aka na Docs Offset Popper.js . |
fallbackPlacement | eriri | n'usoro | 'tụgharịa' | Hapụ ka ịkọwapụta ọnọdụ Popper ga-eji na ọdịda azụ. Maka ozi ndị ọzọ rụtụ aka na akwụkwọ omume Popper.js |
oke | eriri | mmewere | 'mpịakọta nne na nna' | Oke mmachi oke oke nke popover. Nabata ụkpụrụ nke 'viewport' , 'window' , 'scrollParent' , ma ọ bụ HTMLElement ntụaka (naanị JavaScript). Maka ozi ndị ọzọ rụtụ aka na Docs preventoverflow nke Popper.js . |
Njirimara data maka popovers n'otu n'otu
Enwere ike ịkọwa nhọrọ maka popovers n'otu n'otu site na iji njirimara data, dịka akọwara n'elu.
Ụzọ asynchronous na ntụgharị
Ụzọ API niile enweghị atụ wee malite mgbanwe . Ha na-alaghachikwuru onye na-akpọ oku ozugbo mgbanwe ahụ malitere mana tupu ya akwụsị . Na mgbakwunye, a ga-eleghara oku usoro na mpaghara mgbanwe anya .
Na-ebute popovers maka mkpokọta mmewere.
Na-ekpughe popover nke mmewere. Na-alaghachikwute onye na-akpọ oku tupu egosiri popover (ya bụ, tupu shown.bs.popover
mmemme emee). A na-ewere nke a dị ka "akwụkwọ ntuziaka" na-ebute popover. Popovers nke aha ha na ọdịnaya ha bụ ogologo efu anaghị egosipụta.
Na-ezobe popover nke mmewere. Na-alaghachikwute onye na-akpọ oku tupu ezobe popover (ya bụ tupu hidden.bs.popover
mmemme emee). A na-ewere nke a dị ka "akwụkwọ ntuziaka" na-ebute popover.
Na-atụgharị popover nke mmewere. Na-alaghachikwute onye na-akpọ oku tupu egosiri ma ọ bụ zoo popover (ya bụ tupu ihe omume shown.bs.popover
ma ọ bụ hidden.bs.popover
ihe emee). A na-ewere nke a dị ka "akwụkwọ ntuziaka" na-ebute popover.
Na-ezo ma na-ebibi popover nke mmewere. Popovers na-eji nnọchiteanya (nke a na-emepụta site na iji selector
nhọrọ ) enweghị ike ibibi n'otu n'otu na ihe na-akpali akpali.
Na-enye popover nke mmewere ikike igosi ya. Agbanyere popovers site na ndabara.
Na-ewepụ ikike igosi popover element. A ga-enwe ike igosi popover naanị ma ọ bụrụ na agbanyere ya ọzọ.
Na-atụgharị ikike igosi ma ọ bụ zobe ihe popover nke ihe.
Na-emelite ọnọdụ popover element.
Ụdị mmemme | Nkọwa |
---|---|
gosi.bs.popover | Ihe omume a na-agba ọkụ ozugbo show a na-akpọ usoro ihe atụ. |
egosiri.bs.popover | A na-agbapụ ihe omume a mgbe onye ọrụ mere ka popover ahụ hụ ya (ga-echere mgbanwe CSS ka agwụchaa). |
zoo.bs.popover | A na-agbapụ ihe omume a ozugbo hide a kpọrọ usoro ihe atụ. |
zoro ezo.bs.popover | A na-agbapụ ihe omume a mgbe ezoro ezoro onye ọrụ ahụ popover (ga-echere mgbanwe CSS ka agwụchaa). |
etinyere.bs.popover | Emere mmemme a ka emechara ihe show.bs.popover omume mgbe agbakwunyere ndebiri popover na DOM. |