Popovers te an ni
Documentation leh iOS-a hmuh ang chi Bootstrap popovers te chu i site-a element eng pawha dah belh dan tur entirnan.
A tlangpuiin
Popover plugin hman huna hriat tur awmte:
- Popovers te hian positioning atan 3rd party library Popper.js an ring tlat a ni. Popper.min.js hi bootstrap.js hmain i dah tel tur a ni emaw, Popper.js awmna
bootstrap.bundle.min.js
/ hmangbootstrap.bundle.js
tur a ni a, chu chuan popovers a thawh theih nan! - Popovers hian tooltip plugin hi dependency atan a mamawh a ni.
- Kan JavaScript hi source atanga i siam a nih chuan
util.js
. - Popovers hi performance avanga opt-in a nih avangin nangmah ngeiin i initialize tur a ni .
- Zero-length
title
lehcontent
value te hian popover a lantir ngai lovang. container: 'body'
Component complex zawk (kan input group, button group, etc)-a rendering problem awm loh nan specify rawh .- Hidden elements-a popovers trigger hian hna a thawk dawn lo.
- Popovers for
.disabled
ordisabled
elements te chu wrapper element ah trigger tur a ni. - Line hrang hranga wrap anchor atanga trigger a nih chuan popovers te chu anchor zawng zawng zau zawng inkar ah centered a ni ang. Hetiang thiltih hi pumpelh nan
.text-nowrap
i s hmangin hmang rawh .<a>
- Popovers te hi DOM atanga an element inmil te lakchhuah a nih hmain thup a ngai a ni.
- Shadow DOM chhunga element awm vangin popovers a trigger thei a ni.
He component hian animation effect hi prefers-reduced-motion
media query ah a innghat a ni. Kan accessibility documentation a reduced motion tih hi en la .
Entirna thenkhat nen popovers te hnathawh dan hriat duh chuan chhiar chhunzawm zel ang che.
Entirnan: Hmun tinah popovers enable rawh
Page pakhata popover zawng zawng initialize dan pakhat chu an data-toggle
attribute hmanga thlan hi a ni ang:
Entirnan: container
Option hmangin
Popover tibuaitu parent element-a style thenkhat i neih chuan, container
chu element chhungah chuan popover-a HTML chu a lang zawk theih nan custom i dah duh ang.
Entirna
Kawng pali
Option pali a awm a, chunglam, dinglam, hnuai lam, leh veilam aligned te an ni.
A hnuaia click leh hunah dismiss rawh
focus
User-in toggle element aia element dang a click leh hunah popovers chu dismiss turin trigger hmang ang che .
Dismiss-on-next-click atan markup bik a ngai
Cross-browser leh cross-platform behavior dik tak neih theih nan tag ni lovin tag i hmang tur a ni <a>
a , attribute <button>
pawh i dah tel tur a ni.tabindex
Elements tihtawp a ni
Attribute nei element te disabled
hi interactive an ni lo va, chu chu user te chuan popover (or tooltip) trigger turin hover emaw click emaw an ti thei lo tihna a ni. Workaround atan chuan wrapper atanga popover kha trigger <div>
emaw , on the disabled element <span>
override emaw i duh ang.pointer-events
Disabled popover triggers tan chuan i duh zawk thei bawk a, chutiang bawkin popover chu i hmangtute hnenah disabled element clickdata-trigger="hover"
an beisei loh avangin visual feedback nghal ang maia lang turin i duh thei bawk.
Hman dan tur
JavaScript hmangin popovers te chu enable rawh:
Thil thlan theih a ni
Options chu data attribute emaw JavaScript hmangin pass theih a ni. Data attribute atan chuan option hming chu , ah hian append la data-
, data-animation=""
.
Hming | Lampang | Hlawhchhamna | Hrilhfiahna |
---|---|---|---|
animation tih a ni | boolean a ni | dik | Popover ah hian CSS fade transition hmangin apply rawh |
container a ni | string | element | diklo | diklo | Popover chu element bik pakhatah a append thin. Entirnan: |
lungawi | string | element | thiltih | '' tih a ni. |
Function pek a nih chuan a |
titlai | number | thil | 0 a ni | Popover (ms) entir leh thup hun sawn hlat - manual trigger type-ah a huam lo Number supply a nih chuan hide/show pahnih ah delay a awm vek a ni Thil awm dan tur chu: |
html tih a ni | boolean a ni | diklo | Popover ah chuan HTML kha dah lut rawh. False a nih chuan jQuery-a text method hmangin DOM-ah content dah a ni ang. XSS attack i ngaihtuah chuan text hmang rawh. |
dahna tur hmun a ni | string | thiltih | 'dik' | Popover dah dan tur - auto | chunglam | hnuai lam | veilam | dik. Function pakhat hmanga placement hriat chian a nih chuan popover DOM node chu a argument hmasa ber atan leh triggering element DOM node chu a pahnihna atan hmangin koh a ni. Context chu |
selector a ni | string | diklo | diklo | Selector pek a nih chuan popover objects chu target tarlan te hnenah delegate a ni ang. A taka hman chuan hei hi dynamic HTML content-a popovers dah theihna turin hman a ni. Hei hi leh entîrna thu hriat theihna en rawh . |
template a ni | hrui | '<div class="popover" role="tooltip"><div class="arrow"></div><h3 class="popover-header"></h3><div class="popover-body"></div></div>' |
Popover siam huna hman tur HTML base rawh. Popover's Popover's
Wrapper element pawn lam ber chuan |
nihna | string | element | thiltih | '' tih a ni. |
Function pek a nih chuan a |
ti per | hrui | 'click' a ti a. | Popover a tihchhuah dan - | hover rawh | focus | kuta thawh. Trigger tam tak i pass thei a; space hmangin then hran rawh. manual trigger dang nen pawh a inzawm thei lo. |
offset a ni | number | hrui | 0 a ni | Popover chu a target nena khaikhin chuan offset a ni. Hriat belh duh chuan Popper.js-a offset docs en rawh. |
fallbackPlacement tih a ni | string | array a ni | 'vai' | Fallback-ah Popper hian eng position nge a hman dawn tih tarlan phalsak rawh. Hriat belh duh chuan Popper.js-a behavior docs en rawh |
ramri a ni | string | thil bul | 'scrollParent' tih a ni. | Overflow constraint ramri chu popover a ni. 'viewport' , 'window' , 'scrollParent' , emaw HTMLElement reference (JavaScript chauh) value te a pawm . Hriat belh duh chuan Popper.js-a preventOverflow docs en rawh. |
Mimal popovers te tan data attribute te
Popover pakhat zel atana duhthlan tur chu a danglamna chu data attribute hmanga tarlan theih a ni a, a chunga kan sawi tawh ang khan.
Thiltih dan tur
Asynchronous method leh inthlak danglamna te
API method zawng zawng hi asynchronous a ni a , transition a tan vek a ni . Transition an tan veleh mahse a tawp hmain call tu hnenah an kir leh thin . Chu bakah, transitioning component-a method call chu ngaihthah a ni ang .
$().popover(options)
Element collection pakhat atan popovers a initialize thin.
.popover('show')
Element pakhat popover a nihzia a pholang. Popover a lan tak tak hmain (chu chu shown.bs.popover
event a thlen hmain) caller hnenah a kir leh thin. Hei hi popover “manual” triggering anga ngaih a ni. Popovers title leh content pahnih zero-length a nih chuan a lang ngai lo.
.popover('hide')
Element pakhat popover a thup. Popover chu thup tak tak a nih hmain (chu chu hidden.bs.popover
thilthleng a thlen hma) call tu hnenah a kir leh thin. Hei hi popover “manual” triggering anga ngaih a ni.
.popover('toggle')
Element pakhat popover a toggle thin. Popover a lan tak tak emaw a thup hma emaw (chu chu shown.bs.popover
or hidden.bs.popover
event a thlen hma) caller hnenah a kir leh thin. Hei hi popover “manual” triggering anga ngaih a ni.
.popover('dispose')
Element pakhat popover chu a thup a, a tichhe vek bawk. Delegation hmanga siam Popovers ( option hmanga siamselector
) te chu descendant trigger element-ah pakhat zel tihchhiat theih a ni lo.
.popover('enable')
Element pakhat popover chu a lantir theihna a pe. Popovers hi default in enable a ni.
.popover('disable')
Element pakhat popover lantir theihna tur a paih chhuak. Popover hi re-enable a nih chauhvin a lantir theih dawn a ni.
.popover('toggleEnabled')
Element pakhat popover lantir emaw thup emaw theihna tur a toggles.
.popover('update')
Element pakhat popover awmna hmun a update thin.
Thil thlengte
Thil thleng chi hrang hrang | Hrilhfiahna |
---|---|
show.bs.popover tih hi a ni | show He event hi instance method kan koh chuan a fire nghal vek a ni. |
a lantir.bs.popover | He event hi popover chu user hmuh theiha siam a nih hunah fire a ni (CSS transitions zawh hun a nghak ang). |
thup.bs.popover tih hi a ni | hide He event hi instance method koh a nih chuan a fire nghal a ni. |
thup.bs.retheihna | He event hi popover chu user hnen atanga thup a nih zawh chuan fired a ni (CSS transitions zawh hun a nghak ang). |
a rawn dah lut.bs.popover | show.bs.popover He event hi DOM-a popover template dah a nih hunah event zawhah fired a ni. |