Javascript
Weta ngwa Bootstrap na ndụ yana ihe karịrị iri na abuo omenala jQuery plugins. Tinye ha niile n'ụzọ dị mfe, ma ọ bụ n'otu n'otu.
Weta ngwa Bootstrap na ndụ yana ihe karịrị iri na abuo omenala jQuery plugins. Tinye ha niile n'ụzọ dị mfe, ma ọ bụ n'otu n'otu.
Enwere ike itinye ngwa mgbakwunye n'otu n'otu (iji *.js
faịlụ Bootstrap n'otu n'otu), ma ọ bụ ha niile n'otu oge (iji bootstrap.js
ma ọ bụ nke pere mpe bootstrap.min.js
).
Ha abụọ bootstrap.js
nwere bootstrap.min.js
plugins niile n'otu faịlụ. Tinye naanị otu.
Ụfọdụ plugins na akụkụ CSS na-adabere na plugins ndị ọzọ. Ọ bụrụ na ị gụnyere plugins n'otu n'otu, jide n'aka na ịlele maka ndabere ndị a na docs. Rịba ama na plugins niile dabere na jQuery (nke a pụtara jQuery ga-etinyerịrị tupu faịlụ ngwa mgbakwunye). Gaa na anyịbower.json
ka ịhụ ụdị jQuery akwadoro.
Ị nwere ike iji plugins Bootstrap niile naanị site na API akara na-edeghị otu ahịrị Javascript. Nke a bụ API klas mbụ Bootstrap ma kwesịrị ịbụ ihe mbụ ị ga-echebara mgbe ị na-eji ngwa mgbakwunye.
Nke ahụ kwuru, n'ọnọdụ ụfọdụ ọ nwere ike ịdị mma ka gbanyụọ ọrụ a. Ya mere, anyị na-enyekwa ikike iji gbanyụọ njirimara data API site n'iwepụ ihe omume niile dị na akwụkwọ aha ya na data-api
. Nke a dị ka nke a:
N'aka nke ọzọ, iji kwado ngwa mgbakwunye a kapịrị ọnụ, tinye naanị aha ngwa mgbakwunye dị ka oghere aha yana data-api namespace dị ka nke a:
Ejila njirimara data sitere na ọtụtụ plugins n'otu mmewere. Dịka ọmụmaatụ, bọtịnụ enweghị ike ịnwe ntụnye aka ma gbanwee modal. Iji mezuo nke a, jiri ihe mkpuchi.
Anyị kwenyekwara na ị ga-enwe ike iji plugins Bootstrap naanị site na API Javascript. API ọhaneze niile bụ otu, ụzọ enwere ike ịgbanye, wee weghachi mkpokọta emere.
Ụzọ niile kwesịrị ịnakwere ihe nhọrọ nhọrọ, eriri nke lekwasịrị anya otu usoro, ma ọ bụ ihe ọ bụla (nke na-amalite ngwa mgbakwunye nwere omume ndabara):
Ngwa mgbakwunye ọ bụla na-ekpughekwa ihe nrụpụta akụrụngwa ya na akụrụngwa Constructor
: $.fn.popover.Constructor
. Ọ bụrụ na ị ga-achọ ịnweta otu ngwa mgbakwunye ihe atụ, weghachite ya ozugbo na mmewere: $('[rel="popover"]').data('popover')
.
Ị nwere ike ịgbanwe ntọala ndabara maka ngwa mgbakwunye site n'ịgbanwe ihe ngwa mgbakwunye Constructor.DEFAULTS
:
Mgbe ụfọdụ, ọ dị mkpa iji plugins Bootstrap nwere usoro UI ndị ọzọ. N'ọnọdụ ndị a, ndakọrịta oghere aha nwere ike ime mgbe ụfọdụ. Ọ bụrụ na nke a emee, ị nwere ike ịkpọ .noConflict
na ngwa mgbakwunye ịchọrọ iweghachi uru nke.
Bootstrap na-enye mmemme omenala maka ọtụtụ omume pụrụ iche nke plugins. N'ozuzu, ndị a na-abịa n'ụdị njedebe na nke gara aga - ebe njedebe (dịka show
) na-akpalite na mmalite nke mmemme, na ụdị nsonye ya gara aga (dịka shown
) na-akpalite na mmecha nke omume.
Dịka nke 3.0.0, a na-enye aha mmemme Bootstrap niile.
Ihe omume enweghị ngwụcha na-enye preventDefault
ọrụ. Nke a na-enye ikike ịkwụsị mmezu nke ihe tupu ya amalite.
Enwere ike ịnweta ụdị nke ọ bụla nke Bootstrap's jQuery plugins site na VERSION
akụrụngwa nke ihe nrụpụta ngwa mgbakwunye. Dịka ọmụmaatụ, maka ngwa mgbakwunye ngwa ngwa:
Ihe mgbakwunye Bootstrap anaghị ada azụ n'ọmarịcha mgbe Javascript nwere nkwarụ. Ọ bụrụ na ị na-eche banyere ahụmahụ onye ọrụ na nke a, jiri <noscript>
kọwaa ọnọdụ ahụ (na otu esi eme ka Javascript dịghachi) nye ndị ọrụ gị, na / ma ọ bụ gbakwunye ọdịda omenala nke gị.
Bootstrap anaghị akwado ọba akwụkwọ JavaScript nke ndị ọzọ dị ka Prototype ma ọ bụ jQuery UI. N'agbanyeghị .noConflict
na ihe omume kpọpụtara aha, enwere ike ịnwe nsogbu ndakọrịta nke ịchọrọ idozi n'onwe gị.
Maka mmetụta mgbanwe dị mfe, tinye transition.js
otu ugboro n'akụkụ faịlụ JS ndị ọzọ. Ọ bụrụ na ị na-eji nke achịkọtara (ma ọ bụ miniified) bootstrap.js
, ọ dịghị mkpa itinye nke a-ọ dịlarị ebe ahụ.
Transition.js bụ ihe enyemaka bụ isi maka transitionEnd
mmemme yana emulator mgbanwe CSS. Ndị plugins ndị ọzọ na-eji ya iji lelee nkwado mgbanwe CSS yana ijide mgbanwe nkwudo.
Enwere ike gbanyụọ mgbanwe n'ụwa niile site na iji snippet Javascript na-esote, nke ga-abịarịrị mgbe transition.js
(ma bootstrap.js
ọ bụ bootstrap.min.js
, dị ka ọ dị) kwajuru:
A na-ahazi usoro, mana na-agbanwe agbanwe, na-akpalite mkparịta ụka na arụrụ ọrụ kacha nta achọrọ yana ndabara smart.
Jide n'aka na ị gaghị emeghe modal mgbe a ka na-ahụ nke ọzọ. Igosi ihe karịrị otu modal n'otu oge chọrọ koodu omenala.
Gbalịa idowe koodu HTML nke modal n'ọkwa dị elu n'ime akwụkwọ gị iji zere ihe ndị ọzọ na-emetụta ọdịdị na/ma ọ bụ ọrụ modal.
Enwere ụfọdụ ịdọ aka ná ntị gbasara iji modal na ngwaọrụ mkpanaka. Hụ docs nkwado ihe nchọgharị anyị maka nkọwa.
N'ihi ka HTML5 si akọwa semantics ya, autofocus
àgwà HTML enweghị mmetụta na Bootstrap modals. Iji nweta otu mmetụta ahụ, jiri ụfọdụ Javascript omenala:
Modal emepụtara nwere nkụnye eji isi mee, ahụ, na usoro omume n'okpuru ụkwụ.
Gbanwee modal site na JavaScript site na ịpị bọtịnụ dị n'okpuru. Ọ ga-adaba ma daa site n'elu ibe ahụ.
Jide n'aka na ịtinye role="dialog"
na aria-labelledby="..."
, na-ezo aka na aha modal, gaa na .modal
, na role="document"
n'onwe .modal-dialog
ya.
Na mgbakwunye, ịnwere ike ịnye nkọwa nke mkparịta ụka modal gị na aria-describedby
na .modal
.
Ịtinye vidiyo YouTube na ụdịdị chọrọ Javascript agbakwunyere ọ bụghị na Bootstrap ka ọ kwụsị ịkpọghachi na-akpaghị aka na ihe ndị ọzọ. Hụ akwụkwọ ozi Stack Overflow a na-enyere aka maka ozi ndị ọzọ.
Modal nwere nha nhọrọ abụọ, dị site na klaasị modifier ka etinye ya na .modal-dialog
.
Maka ụdịdị ndị na-apụta karịa ka ị ga-adaba ka ilele, wepụ .fade
klaasị na akara modal gị.
Iji nweta uru nke usoro grid Bootstrap n'ime modal, naanị akwụ .row
n'ime .modal-body
wee jiri klaasị sistemu grid nkịtị.
Nwee ụyọkọ bọtịnụ niile na-akpalite otu modal, naanị nwere ọdịnaya dịtụ iche? Jiri event.relatedTarget
na njirimara HTMLdata-*
(ikekwe site na jQuery ) iji gbanwee ọdịnaya nke modal dabere na bọtịnụ a pịrị. Hụ docs Modal Events maka nkọwa na relatedTarget
,
Ngwa mgbakwunye modal na-agbanwe ọdịnaya gị zoro ezo na ọchịchọ, site na njirimara data ma ọ bụ Javascript. Ọ na-agbakwụnye .modal-open
na <body>
ịkagbu omume mpịakọta ndabara ma na-ebute a .modal-backdrop
iji nye mpaghara ọpịpị maka ịchụpụ modals egosiri mgbe ịpị na mpụga modal.
Mee modal rụọ ọrụ na-edeghị Javascript. Tọọ data-toggle="modal"
na ihe njikwa, dị ka bọtịnụ, yana otu data-target="#foo"
ma ọ bụ href="#foo"
iji lekwasịrị anya otu modal ka ị gbanwee.
Kpọọ modal nwere id myModal
nwere otu ahịrị 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-backdrop=""
.
Aha | ụdị | ndabara | nkọwa |
---|---|---|---|
ndabere | boolean ma ọ bụ eriri'static' |
eziokwu | Na-agụnye ihe modal-backdrop element. Nhọrọ, ezipụta static maka backdrop nke na-adịghị emechi modal na pịa. |
ahụigodo | boolean | eziokwu | Na-emechi modal mgbe ịpịrị igodo mgbapụ |
gosi | boolean | eziokwu | Na-egosi modal mgbe ebido ya. |
ime ime | uzo | ụgha | Akwụsịla nhọrọ a kemgbe v3.3.0 ma wepụrụ ya na v4. Anyị na-akwado kama iji templating-akụkụ ndị ahịa ma ọ bụ usoro njikọ data, ma ọ bụ kpọọ jQuery.load onwe gị. Ọ bụrụ na enyere URL dịpụrụ adịpụ, a ga-ebuba ọdịnaya otu oge site na usoro jQuery |
.modal(options)
Na-eme ka ọdịnaya gị rụọ ọrụ dị ka modal. Nabata nhọrọ nhọrọ object
.
.modal('toggle')
Iji aka na-atụgharị modal. Na-alaghachikwute onye na-akpọ oku tupu egosiri modal ma ọ bụ zoo (ya bụ tupu ihe omume shown.bs.modal
ma ọ bụ hidden.bs.modal
ihe emee).
.modal('show')
Iji aka na-emepe modal. Na-alaghachikwute onye na-akpọ oku tupu egosiri modal n'ezie (ya bụ tupu shown.bs.modal
mmemme emee).
.modal('hide')
Iji aka na-ezobe modal. Na-alaghachikwute onye na-akpọ oku tupu ezobe modal ahụ (ya bụ tupu hidden.bs.modal
mmemme emee).
.modal('handleUpdate')
Na-emezi ọnọdụ modal ahụ ka ọ ghara imechi akwụkwọ mpịakọta ma ọ bụrụ na otu ga-apụta, nke ga-eme ka modal wulie elu n'aka ekpe.
Naanị achọrọ mgbe ịdị elu nke modal gbanwere mgbe ọ na-emeghe.
Klas modal Bootstrap na-ekpughe ihe omume ole na ole maka ịbanye n'ime ọrụ modal.
A na-achụpụ ihe omume modal na modal n'onwe ya (ya bụ na <div class="modal">
).
Ụdị mmemme | Nkọwa |
---|---|
gosi.bs.modal | Ihe omume a na-agba ọkụ ozugbo show a na-akpọ usoro ihe atụ. Ọ bụrụ na ọpịpị kpatara ya, ihe pịrị apị dị ka relatedTarget ihe nke mmemme ahụ. |
egosiri.bs.modal | A na-achụpụ ihe omume a mgbe onye ọrụ mere ka modal ahụ anya (ga-echere mgbanwe CSS ka ọ gwụchaa). Ọ bụrụ na ọpịpị kpatara ya, ihe pịrị apị dị ka relatedTarget ihe nke mmemme ahụ. |
zoo.bs.modal | A na-agbapụ ihe omume a ozugbo hide a kpọrọ usoro ihe atụ. |
zoro ezo.bs.modal | A na-achụpụ ihe omume a mgbe ezoro ezoro ya n'aka onye ọrụ modal (ga-echere mgbanwe CSS ka agwụchaa). |
eburu.bs.modal | A na-achụpụ ihe omume a mgbe modal bujuru ọdịnaya site na iji remote nhọrọ. |
Tinye menu ndọda n'ihe fọrọ nke nta ka ọ bụrụ ihe ọ bụla nwere ngwa mgbakwunye a dị mfe, gụnyere navbar, taabụ, na ọgwụ.
Site na njirimara data ma ọ bụ Javascript, ngwa mgbakwunye na-atụgharị ọdịnaya zoro ezo (nchịkọta mkpọda) site na ịtụgharị .open
klaasị na ihe ndepụta nne na nna.
Na ngwaọrụ mkpanaaka, imepe ndọda na-agbakwunye .dropdown-backdrop
dị ka mpaghara mgbata maka imechi menu ndetu mgbe ị na-akụ na mpụga menu, ihe achọrọ maka nkwado iOS kwesịrị ekwesị. Nke a pụtara na ịgbanwee site na menu ndọpụta mepere emepe gaa na menu ndetu dị iche chọrọ mgbakwunye mgbakwunye na mkpanaka.
Mara: A data-toggle="dropdown"
na-adabere na njirimara a maka imechi menus dropdown na ọkwa ngwa, yabụ ọ dị mma iji ya mgbe niile.
Tinye data-toggle="dropdown"
na njikọ ma ọ bụ bọtịnụ ka ịgbanwee mkpọda.
Iji mee ka URL ghara ịdị na ya na bọtịnụ njikọ, jiri data-target
njirimara kama href="#"
.
Kpọọ dropdowns site na Javascript:
data-toggle="dropdown"
ka achọrọN'agbanyeghị ma ị na-akpọ dropdown gị site na Javascript ma ọ bụ kama iji data-api, data-toggle="dropdown"
a na-achọrọ mgbe niile ịnọ na ihe mkpalite dropdown.
Ọ dịghị
$().dropdown('toggle')
Na-atụgharị menu mwụda nke navbar enyere ma ọ bụ igodo taabụ.
A na-achụpụ mmemme ndakpọ niile na .dropdown-menu
mmewere nne na nna.
Ihe mwụda niile nwere relatedTarget
akụrụngwa, nke uru ya bụ mmewere arịlịka na-atụgharị.
Ụdị mmemme | Nkọwa |
---|---|
gosi.bs.dropdown | Ihe omume a na-agba ọkụ ozugbo a na-akpọ usoro ihe ngosi. |
egosiri.bs.dropdown | A na-agbapụ mmemme a mgbe onye ọrụ mere ka mwepu ahụ hụ ya (ga-echere mgbanwe CSS, ka emechaa). |
zoo.bs.dropdown | A na-agbapụ mmemme a ozugbo a kpọrọ usoro ihe nleba anya. |
zoro ezo.bs.dropdown | A na-agbapụ mmemme a mgbe ezoro ezoro ya n'aka onye ọrụ dropdown (ga-echere mgbanwe CSS, iji wuchaa). |
Ihe mgbakwunye ScrollSpy bụ maka imelite ebumnuche nav na-akpaghị aka dabere na ọnọdụ mpịakọta. Pịgharịa mpaghara n'okpuru ebe ịnya ụgbọ mmiri wee lelee klaasị na-agbanwe agbanwe. A ga-eme ka ọ pụta ìhè nke obere ihe ndọpụta.
Ad leggings keytar, brunch id art party dolor labour. Pitchfork yr enim lo-fi tupu ha ere qui. Ikike igwe kwụ otu ebe Tumblr ugbo gaa na tebụl ihe ọ bụla. Anim keffiyeh carles cardigan. Ụlọ foto Velit seitan mcsweeney 3 wolf moon irure. Cosby sweta lomo jean shorts, williamsburg hoodie minim qui eleghị anya, ị nụbeghị banyere ha et cardigan Trust fund culpa biodiesel wes anderson aesthetic. Nihil egbugbu accusamus, cred irony biodiesel keffiyeh artisan ullamco consequat.
Veniam marfa afụ ọnụ skateboard, adipisicing fugiat velit pitchfork afụ ọnụ. Freegan afụ ọnụ ma ọ bụ mcsweeney's vero. Cupidatat anọ ebe nisi, ma helvetica nulla carles. gwongworo nri cosby sweta egbugbu, mcsweeney's quis non freegan vinyl. Lo-fi wes anderson +1 sartorial. Carles na-adịghị mma mmega ahụ gentrify. Brooklyn adipisicing craft biya vice keytar deserunt.
Occaecat commodo aliqua delectus. Fap craft biya deserunt skateboard ea. Lomo bicycle rights adipisicing banh mi, velit ea sunt next level locavore single-origin coffee in magna veniam. High life id vinyl, echo park consequat quis aliquip banh mi pitchfork. Vero VHS kacha mma. Consectetur nisi DIY minim bag. Cred ex in, sustainable delectus consectetur fanny pack iphone.
In incididunt echo park, officia deserunt mcsweeney's proident master cleanse thundercats sapiente veniam. Excepteur VHS elit, proident shoreditch +1 biodiesel laborum craft beer. Single-origin coffee wayfarers irure four loko, cupidatat terry richardson master cleanse. Assumenda you probably haven't heard of them art party fanny pack, tattooed nulla cardigan tempor ad. Proident wolf nesciunt sartorial keffiyeh eu banh mi sustainable. Elit wolf voluptate, lo-fi ea portland before they sold out four loko. Locavore enim nostrud mlkshk brooklyn nesciunt.
Ad leggings keytar, brunch id art party dolor labore. Pitchfork yr enim lo-fi before they sold out qui. Tumblr farm-to-table bicycle rights whatever. Anim keffiyeh carles cardigan. Velit seitan mcsweeney's photo booth 3 wolf moon irure. Cosby sweater lomo jean shorts, williamsburg hoodie minim qui you probably haven't heard of them et cardigan trust fund culpa biodiesel wes anderson aesthetic. Nihil tattooed accusamus, cred irony biodiesel keffiyeh artisan ullamco consequat.
Keytar twee blog, culpa ozi akpa marfa ọ bụla delectus nri gwongworo. Sapiente synth id echere. Locavore sed helvetica cliche irony, thundercats eleghị anya ị nụbeghị banyere ha na-akpata hoodie gluten-free lo-fi fap aliquip. Ụlọ ọrụ dị elu tupu ha ere, Terry Richardson proident brunch nesciunt quis cosby sweta pariatur keffiyeh ut helvetica artisan. Cardigan craft biya seitan readymade velit. VHS chambray laboris tempor veniam. Anim mollit minim commodo ullamco thundercats.
Njikọ Navbar ga-enwerịrị ebumnuche id nwere ike idozi. Dịka ọmụmaatụ, a <a href="#home">home</a>
ga-ederịrị ihe na DOM dịka <div id="home"></div>
.
:visible
ebumnuche leghaara anyaA ga-eleghara ihe ndị ezubere iche na-abụghị :visible
nke jQuery si dị na agaghị eme ka ihe ndị nav ha dabara adaba pụta ìhè.
N'agbanyeghị usoro mmejuputa atumatu, scrollspy chọrọ iji position: relative;
na mmewere ị na-enyocha. N'ọtụtụ ọnọdụ, nke a bụ <body>
. Mgbe ị na-atụgharị na ihe ndị ọzọ na-abụghị nke <body>
, jide n'aka na ị nwere height
nhazi ma overflow-y: scroll;
tinye ya.
Ka ịtinye omume scrollspy ngwa ngwa na igodo topbar gị, gbakwunye data-spy="scroll"
na mmewere ịchọrọ iledo (kacha nke a ga-abụ <body>
). Wee tinye data-target
njirimara na ID ma ọ bụ klas nke ihe nne na nna nke .nav
akụrụngwa Bootstrap ọ bụla.
Ka ịgbakwunye position: relative;
na CSS gị, kpọọ scrollspy site na Javascript:
.scrollspy('refresh')
Mgbe ị na-eji scrollspy yana mgbakwunye ma ọ bụ wepụ ihe ndị sitere na DOM, ị ga-akpọ usoro ume ọhụrụ dị ka:
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-offset=""
.
Aha | ụdị | ndabara | nkọwa |
---|---|---|---|
nkwụsị | nọmba | 10 | Pikselụ ka a ga-esi n'elu pụta mgbe ị na-agbakọ ọnọdụ mpịakọta. |
Ụdị mmemme | Nkọwa |
---|---|
rụọ ọrụ.bs.scrollspy | Ihe omume a na-agba ọkụ mgbe ọ bụla ihe ọhụrụ na-arụ ọrụ site na scrollspy. |
Tinye ngwa ngwa taabụ arụ ọrụ ike ka ị gbanwee site na pane nke ọdịnaya mpaghara, ọbụlagodi site na nchịkọta nhọrọ. Anaghị akwado taabụ akwụ akwụrụ.
Raw denim eleghị anya ị nụbeghị maka ha jeans shorts Austin. Nesciunt tofu stumptown aliqua, retro synth master sachapụ. Afụ ọnụ cliche tempor, williamsburg carles vegan helvetica. Reprehenderit onye na-egbu anụ retro keffiyeh dreamcatcher synth. Cosby sweta eu banh mi, qui irure terry richardson ex squid. Họrọ ebe salvia cillum iphone. Seitan aliquip quis cardigan uwe ndị America, anụ anụ voluptate bụ isi qui.
Food truck fixie locavore, accusamus mcsweeney's marfa nulla single-origin coffee squid. Exercitation +1 labore velit, blog sartorial PBR leggings next level wes anderson artisan four loko farm-to-table craft beer twee. Qui photo booth letterpress, commodo enim craft beer mlkshk aliquip jean shorts ullamco ad vinyl cillum PBR. Homo nostrud organic, assumenda labore aesthetic magna delectus mollit. Keytar helvetica VHS salvia yr, vero magna velit sapiente labore stumptown. Vegan fanny pack odio cillum wes anderson 8-bit, sustainable jean shorts beard ut DIY ethical culpa terry richardson biodiesel. Art party scenester stumptown, tumblr butcher vero sint qui sapiente accusamus tattooed echo park.
Etsy mixtape wayfarers, ethical wes anderson tofu before they sold out mcsweeney's organic lomo retro fanny pack lo-fi farm-to-table readymade. Messenger bag gentrify pitchfork tattooed craft beer, iphone skateboard locavore carles etsy salvia banksy hoodie helvetica. DIY synth PBR banksy irony. Leggings gentrify squid 8-bit cred pitchfork. Williamsburg banh mi whatever gluten-free, carles pitchfork biodiesel fixie etsy retro mlkshk vice blog. Scenester cred you probably haven't heard of them, vinyl craft beer blog stumptown. Pitchfork sustainable tofu synth chambray yr.
Trust fund seitan letterpress, keytar raw denim keffiyeh etsy art party before they sold out master cleanse gluten-free squid scenester freegan cosby sweater. Fanny pack portland seitan DIY, art party locavore wolf cliche high life echo park Austin. Cred vinyl keffiyeh DIY salvia PBR, banh mi before they sold out farm-to-table VHS viral locavore cosby sweater. Lomo wolf viral, mustache readymade thundercats keffiyeh craft beer marfa ethical. Wolf salvia freegan, sartorial keffiyeh echo park vegan.
Ngwa mgbakwunye a na-agbatị mpaghara igodo ụzọ tabbed iji gbakwunye mpaghara tabbable.
Kwado taabụ tabbable site na Javascript (taabụ ọ bụla kwesịrị ịgbalite n'otu n'otu):
Ị nwere ike ịgbalite taabụ n'otu n'otu n'ụzọ dị iche iche:
Ị nwere ike ịgbalite taabụ ma ọ bụ pill navigation na-edeghị Javascript ọ bụla site na ịkọwapụta data-toggle="tab"
ma ọ bụ data-toggle="pill"
na mmewere. Ịgbakwunye nav
na nav-tabs
klaasị na taabụ ga-etinye aka na nhazi taabụul
Bootstrap , ebe ị na-agbakwunye na klaasị ga-etinye ụdị pill .nav
nav-pills
Iji mee ka taabụ daa, tinye .fade
na nke ọ bụla .tab-pane
. Iberibe taabụ nke mbụ ga-enwerịrịrịrị .in
ime ka a hụ ọdịnaya mbụ.
$().tab
Na-arụ ọrụ mmemme taabụ na akpa ọdịnaya. Tab kwesịrị inwe ma ọ data-target
bụ ihe href
ezubere iche maka ọnụ akpa na DOM. N'ihe atụ ndị dị n'elu, taabụ bụ <a>
s nwere data-toggle="tab"
njirimara.
.tab('show')
Họrọ taabụ enyere wee gosi ọdịnaya metụtara ya. Taabụ ọ bụla ahọpụtara na mbụ na-aghọ nke anaghị ahọpụtara yana ọdịnaya metụtara ya zoro ezo. Na-alaghachi na onye na-akpọ oku tupu egosiri pane taabụ n'ezie (ya bụ tupu shown.bs.tab
mmemme emee).
Mgbe ị na-egosi taabụ ọhụrụ, mmemme ahụ na-agba ọkụ n'usoro a:
hide.bs.tab
(na taabụ na-arụ ọrụ ugbu a)show.bs.tab
(na taabụ a ga-egosi)hidden.bs.tab
(na taabụ arụ ọrụ gara aga, otu maka mmemme hide.bs.tab
ahụ)shown.bs.tab
(na taabụ egosiri ọhụrụ na-arụ ọrụ, otu maka mmemme show.bs.tab
ahụ)Ọ bụrụ na ọ nweghị taabụ na-arụ ọrụ, mgbe ahụ, agaghị achụpụ ihe omume hide.bs.tab
na mmemme.hidden.bs.tab
Ụdị mmemme | Nkọwa |
---|---|
gosi.bs.tab | Ihe omume a na-agba ọkụ na ihe ngosi taabụ, mana tupu egosiri taabụ ọhụrụ. Jiri event.target ma event.relatedTarget tụọ taabụ nọ n'ọrụ yana taabụ arụ ọrụ gara aga (ọ bụrụ na ọ dị) n'otu n'otu. |
egosiri.bs.taabụ | Ihe omume a na-agba ọkụ na ihe ngosi taabụ ka egosiri taabụ. Jiri event.target ma event.relatedTarget tụọ taabụ nọ n'ọrụ yana taabụ arụ ọrụ gara aga (ọ bụrụ na ọ dị) n'otu n'otu. |
zoo.bs.tab | Ihe omume a na-agba ọkụ mgbe a ga-egosi taabụ ọhụrụ (ya mere a ga-ezobe taabụ arụ ọrụ gara aga). Jiri event.target na event.relatedTarget dobe taabụ na-arụ ọrụ ugbu a yana taabụ ọhụrụ ga-arụ ọrụ n'oge adịghị anya, n'otu n'otu. |
zoro ezo.bs.tab | Ihe omume a na-agba ọkụ ka egosiri taabụ ọhụrụ (ma yabụ na-ezobe taabụ arụ ọrụ gara aga). Jiri event.target ma event.relatedTarget dobe taabụ nọ n'ọrụ gara aga yana taabụ arụ ọrụ ọhụrụ, n'otu n'otu. |
Site na ngwa mgbakwunye jQuery.tipsy mara mma nke Jason Frame dere; Ntuziaka ngwaọrụ bụ ụdị emelitere, nke anaghị adabere na onyonyo, jiri CSS3 maka eserese, yana njirimara data maka nchekwa aha mpaghara.
Agaghị egosipụta ndụmọdụ ndụmọdụ nwere aha ogologo efu.
Gaa na njikọ dị n'okpuru ka ịhụ ndụmọdụ ndụmọdụ:
Ọkpa ogologo ọkpa next level keffiyeh eleghị anya ị nụbeghị maka ha. Foto ụlọ afụ ọnụ raw denim akwụkwọ ozi vegan messenger akpa stumptown. Ugbo-na-tebulu seitan, mcsweeney's fixie sustainable quinoa 8-bit American uwe nwere Terry Richardson vinyl chambray. Ogige ajị agba, cardigans banh mi lomo thundercats. Tofu biodiesel williamsburg marfa, anọ loko mcsweeney si sachaa vegan chambray. A really ironic artisan whatever keytar , scenester farm-to-table banksy Austin twitter handle freegan cred raw denim single-origin coffee viral.
Nhọrọ anọ dị: n'elu, aka nri, ala na aka ekpe kwadoro.
Maka ebumnuche arụmọrụ, Tooltip na Popover data-apis abanyela, nke pụtara na ị ga-ebido ya n'onwe gị .
Otu ụzọ isi bido ndụmọdụ ngwaọrụ niile na ibe ga-abụ ịhọrọ ha site na data-toggle
njirimara ha:
Ngwa mgbakwunye Tooltip na-ewepụta ọdịnaya na akara n'ọchịchọ, yana site na ndabara na-etinye ndụmọdụ ngwaọrụ mgbe ihe mkpalite ha gasịrị.
Kpalite ntụnye aka site na Javascript:
Ihe nrịbama achọrọ maka ngwa ọrụ bụ naanị njiri mara data
yana title
na mmewere HTML ịchọrọ ịnwe ntụnye aka. Ihe nrịbama emepụtara nke ngwa ọrụ dị mfe, n'agbanyeghị na ọ chọrọ ọnọdụ (site na ndabara, top
nke ngwa mgbakwunye setịpụrụ).
Mgbe ụfọdụ, ịchọrọ ịgbakwunye ngwa ọrụ na hyperlink nke jikọtara ọtụtụ ahịrị. Omume ndabara nke ngwa mgbakwunye tooltip bụ ịgbado ya n'ahịrị na kwụ ọtọ. Tinye white-space: nowrap;
na arịlịka gị ka ịzere nke a.
Mgbe ị na-eji Tooltips na ihe dị n'ime a .btn-group
ma ọ bụ ihe .input-group
, ma ọ bụ na tebụl metụtara ( <td>
, <th>
, <tr>
, <thead>
, <tbody>
, <tfoot>
), ị ga-ezipụta nhọrọ container: 'body'
(ederede n'okpuru) iji zere mmetụta ndị achọghị (dị ka mmewere na-eto eto na/ ma ọ bụ na-efunahụ akụkụ ya gbara okirikiri mgbe etinyere ngwa ọrụ).
Maka ndị ọrụ ji ahụigodo na-eme njem, yana ọkachasị ndị ọrụ teknụzụ enyemaka, ị ga-etinye naanị ndụmọdụ ngwaọrụ na ihe ndị nwere ike ilekwasị anya na ahụigodo dị ka njikọ, njikwa ụdị, ma ọ bụ mmewere ọ bụla aka ike nwere njiri mara tabindex="0"
.
Iji tinye ntụnye aka na ihe disabled
ma ọ bụ .disabled
mmewere, tinye mmewere n'ime a <div>
wee tinye ntụnye aka na nke ahụ <div>
kama.
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 CSS na-agwụ n'isi ngwaọrụ |
akpa | eriri | ụgha | ụgha | Na-agbakwunye ntụnye aka na otu mmewere. Ọmụmaatụ |
igbu oge | nọmba | ihe | 0 | Ngosipụta na izochi ngwa ọrụ (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 ngwa ọrụ. Ọ 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ụ | 'n'elu' | Otu esi edobe ngwa ọrụ - top | ala | aka ekpe | aka nri | akpaaka. Mgbe a na-eji ọrụ iji chọpụta ntinye, a na-akpọ ya na ngwá ọrụ DOM node dị ka arụmụka mbụ ya na ihe na-akpali akpali DOM node dị ka nke abụọ ya. A |
onye nhọpụta | eriri | ụgha | Ọ bụrụ na enyere onye nhọpụta, a ga-ekenye ihe nrịbama ngwaọrụ na ebumnuche ndị akọwapụtara. Na omume, a na-eji nke a mee ka ọdịnaya HTML dị ike ka agbakwunyere ndụmọdụ ngwaọrụ. Hụ nke a na ihe atụ na-enye nkọwa . |
ndebiri | eriri | '<div class="tooltip" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>' |
Base HTML ka ị ga-eji mgbe ị na-eke ihe nrụtụ aka. A
Ihe mkpuchi nke dị n'elu kwesịrị inwe |
aha | eriri | ọrụ | '' | Uru aha ndabara ma ọ bụrụ Ọ bụrụ na enyere ọrụ, a ga-akpọ ya na |
ịkpalite | eriri | 'hover focus' | Olee otú Tooltip na-akpalite - pịa | hover | lekwasịrị anya | akwụkwọ ntuziaka. Ị nwere ike ịgafe ọtụtụ ihe mkpali; kewaa ha na oghere. manual enweghị ike ijikọ ya na mkpalite ọ bụla ọzọ. |
nlegharị anya | eriri | ihe | ọrụ | {nhọrọ: 'ahu', padding: 0} | Na-edobe ngwa ọrụ n'ime oke nke mmewere a. Ọmụmaatụ: Ọ bụrụ na enyere ọrụ, a na-akpọ ya na ihe na-akpali akpali DOM node dị ka naanị arụmụka ya. A |
Enwere ike ịkọwa nhọrọ maka ndụmọdụ ngwaọrụ n'otu n'otu site na iji njirimara data, dịka akọwara n'elu.
$().tooltip(options)
Na-ejikọta onye na-ahụ maka ndụmọdụ ngwaọrụ na mkpokọta mmewere.
.tooltip('show')
Na-ekpughe ngwa ọrụ mmewere. Na-alaghachikwute onye na-akpọ oku tupu egosipụta ngwa ọrụ (ya bụ tupu shown.bs.tooltip
mmemme emee). A na-ewere nke a dị ka "akwụkwọ ntuziaka" na-akpalite ntụpọ ngwá ọrụ. Agaghị egosipụta ndụmọdụ ndụmọdụ nwere aha ogologo efu.
.tooltip('hide')
Na-ezobe ntụaka ngwa ọrụ mmewere. Na-alaghachikwute onye na-akpọ oku tupu ezobe ngwa ọrụ n'ezie (ya bụ tupu hidden.bs.tooltip
mmemme emee). A na-ewere nke a dị ka "akwụkwọ ntuziaka" na-akpalite ntụpọ ngwá ọrụ.
.tooltip('toggle')
Na-atụgharị ihe ntụnye aka nke mmewere. Na-alaghachikwute onye na-akpọ oku tupu egosipụta ma ọ bụ ezoro ezo emetụ aka (ya bụ tupu ihe shown.bs.tooltip
omume hidden.bs.tooltip
ahụ emee). A na-ewere nke a dị ka "akwụkwọ ntuziaka" na-akpalite ntụpọ ngwá ọrụ.
.tooltip('destroy')
Na-ezo ma na-ebibi ngwa ọrụ mmewere. Enweghị ike ibibi ndụmọdụ ndị na-eji ndị nnọchi anya (nke emepụtara site na iji selector
nhọrọ ) n'otu n'otu na ihe na-akpali akpali.
Ụdị mmemme | Nkọwa |
---|---|
gosi.bs.tooltip | Ihe omume a na-agba ọkụ ozugbo show a na-akpọ usoro ihe atụ. |
egosiri.bs.tooltip | A na-agbapụ ihe omume a mgbe onye ọrụ mere ka ọ hụ ihe nrịbama ngwaọrụ ahụ (ga-echere mgbanwe CSS ka agwụchaa). |
zoo.bs.tooltip | A na-agbapụ ihe omume a ozugbo hide a kpọrọ usoro ihe atụ. |
zoro ezo.bs.tooltip | A na-agbapụ ihe omume a mgbe ezoro ezoro ya n'aka onye ọrụ (ga-echere mgbanwe CSS ka agwụchaa). |
tinye.bs.tooltip | A na-achụpụ ihe omume a mgbe ihe show.bs.tooltip omume ahụ gasịrị mgbe agbakwunyere template Tooltip na DOM. |
Tinye obere ihe machie nke ọdịnaya, dị ka ndị dị na iPad, na ihe ọ bụla maka ozi nke abụọ nke ụlọ.
Popovers nke aha ha na ọdịnaya ha bụ ogologo efu anaghị egosipụta.
Popovers chọrọ ka etinyere ngwa mgbakwunye na ụdị Bootstrap gị.
Maka ebumnuche arụmọrụ, Tooltip na Popover data-apis abanyela, nke pụtara na ị ga-ebido ya n'onwe gị .
Otu ụzọ isi bido popovers niile na ibe ga-abụ ịhọrọ ha site na data-toggle
njirimara ha:
Mgbe ị na-eji popovers na ihe dị n'ime a .btn-group
ma ọ bụ ihe .input-group
, ma ọ bụ na ihe ndị metụtara tebụl ( <td>
, <th>
, <tr>
, <thead>
, <tbody>
, <tfoot>
), ị ga-akọwapụta nhọrọ container: 'body'
(ederede n'okpuru) iji zere mmetụta ndị achọghị (dị ka mmewere na-eto eto na/ ma ọ bụ na-efunahụ akụkụ ya gbara okirikiri mgbe a kpalitere popover).
Ka ịgbakwunye popover na a disabled
ma ọ bụ .disabled
mmewere, tinye mmewere n'ime a <div>
ma tinye popover na nke ahụ <div>
kama.
Mgbe ụfọdụ, ịchọrọ ịgbakwunye popover na hyperlink nke jikọtara ọtụtụ ahịrị. Omume ndabara nke ngwa mgbakwunye popover bụ ịgbado ya n'ahịrị na kwụ ọtọ. Tinye white-space: nowrap;
na arịlịka gị ka ịzere nke a.
Nhọrọ anọ dị: n'elu, aka nri, ala na aka ekpe kwadoro.
Sed posuere consectetur est na lobortis. Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum.
Sed posuere consectetur est na lobortis. Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum.
Sed posuere consectetur est na lobortis. Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum.
Sed posuere consectetur est na lobortis. Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum.
Jiri focus
mkpalite ka ịchụpụ popovers na ịpị na-esote nke onye ọrụ na-eme.
Maka ihe nchọgharị kwesịrị ekwesị na omume cross-platform, ị ga-eji <a>
mkpado, ọ bụghị mkpado <button>
, na ị ga-agụnyerịrị role="button"
na tabindex
àgwà.
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 | ụgha | ụgha | Na-agbakwunye popover na otu mmewere. Ọmụmaatụ |
ọdịnaya | eriri | ọ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 etinye popover - top | ala | aka ekpe | aka nri | akpaaka. 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 | Ọ 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-title"></h3><div class="popover-content"></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 | ọ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. manual enweghị ike ijikọ ya na mkpalite ọ bụla ọzọ. |
nlegharị anya | eriri | ihe | ọrụ | {nhọrọ: 'ahu', padding: 0} | Na-edobe popover n'ime oke nke mmewere a. Ọmụmaatụ: Ọ bụrụ na enyere ọrụ, a na-akpọ ya na ihe na-akpali akpali DOM node dị ka naanị arụmụka ya. Edebere |
Enwere ike ịkọwa nhọrọ maka popovers n'otu n'otu site na iji njirimara data, dịka akọwara n'elu.
$().popover(options)
Na-ebute popovers maka mkpokọta mmewere.
.popover('show')
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.
.popover('hide')
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.
.popover('toggle')
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.
.popover('destroy')
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.
Ụ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. |
Tinye ọrụ achụpụ na ozi njikere niile na ngwa mgbakwunye a.
Mgbe ị na-eji .close
bọtịnụ, ọ ga-abụrịrị nwa mbụ nke .alert-dismissible
na ọ nweghị ọdịnaya ederede nwere ike ịbịa n'ihu ya na akara ngosi.
Gbanwee nke a na nke ahụ wee nwaa ọzọ. Duis mollis, est non commodo luctus, nisi erat porttitor ligula, eget lacinia odio sem nec elit. Cras mattis consectetur purus sit amet fermentum.
Naanị tinye data-dismiss="alert"
na bọtịnụ mmechi gị iji nye ọrụ nso nsonye na-akpaghị aka. Imechi mkpu na-ewepụ ya na DOM.
Iji mee ka ngosi gị jiri animation mgbe emechiri, hụ na ha nwere .fade
na.in
klaasị etinyegoro na ha.
$().alert()
Na-eme ka anya na-ege ntị maka ihe omume pịa na ihe ndị sitere na nke nwere data-dismiss="alert"
njirimara. (Ọ dịghị mkpa mgbe ị na-eji data-api's auto-mmalite.)
$().alert('close')
Na-emechi mkpu site na iwepu ya na DOM. Ọ bụrụ .fade
na .in
klaasị dị na mmewere, njikere ga-apụ apụ tupu ewepụ ya.
Ngwa mgbakwunye njikere Bootstrap na-ekpughere ihe omume ole na ole maka itinye aka n'ime ọrụ njikere.
Ụdị mmemme | Nkọwa |
---|---|
nso.bs.leti | Ihe omume a na-agba ọkụ ozugbo close a na-akpọ usoro ihe atụ. |
mechiri emechi.bs.alert | A na-achụpụ ihe omume a mgbe emechiela njikere (ga-echere mgbanwe CSS ka ọ mechaa). |
Jiri bọtịnụ mee ihe ndị ọzọ. Bọtịnụ njikwa na-ekwu ma ọ bụ mepụta otu bọtịnụ maka ihe ndị ọzọ dị ka ogwe ngwaọrụ.
Firefox na-aga n'ihu n'ụdị nchịkwa nchịkwa (nkwarụ na nlele) n'ofe ibu ibe . Ihe ngwọta maka nke a bụ iji autocomplete="off"
. Lee ahụhụ Mozilla #654072 .
Tinye data-loading-text="Loading..."
ka iji ọnọdụ nbudata na bọtịnụ.
Akwụsịla atụmatụ a kemgbe v3.3.5 ma wepụrụ ya na v4.
Maka ngosipụta a, anyị na-eji data-loading-text
na $().button('loading')
, mana nke ahụ abụghị naanị steeti ị nwere ike iji. Hụkwuo na nke a n'okpuru $().button(string)
akwụkwọ .
Tinye data-toggle="button"
ka ịgbalite toggling n'otu bọtịnụ.
.active
naaria-pressed="true"
Maka bọtịnụ agbagoro agbagoro, ị ga-agbakwunyerịrị .active
klas ahụ na aria-pressed="true"
njirimara ya button
n'onwe gị.
Tinye data-toggle="buttons"
na .btn-group
igbe nrịbama ma ọ bụ ntinye redio nwere ka ị nwee ike ịtụgharị n'ụdị ha.
.active
Maka nhọrọ ahọpụtara, ị ga-agbakwunyerịrị .active
klas ahụ na ntinye nke label
onwe gị.
Ọ bụrụ na emelitere ọnọdụ bọtịnụ igbe nrịbama na-agbaghị click
mmemme na bọtịnụ (dịka site na <input type="reset">
ma ọ bụ site na ịtọ checked
akụrụngwa nke ndenye), ị ga-achọ ịgbanye .active
klaasị na ntinye ahụ label
n'onwe gị.
$().button('toggle')
Tụgharịa steeti. Na-enye bọtịnụ ka ọ dị ka agbanyere ya.
$().button('reset')
Tọgharịa steeti bọtịnụ - gbanwee ederede na ederede izizi. Usoro a enweghị isi wee laghachi tupu ntọgharị ahụ agwụcha.
$().button(string)
Na-agbanwe ederede na ọnọdụ ederede akọwapụtara data ọ bụla.
Ngwa mgbakwunye na-agbanwe agbanwe nke na-eji obere klaasị mee mgbanwe omume dị mfe.
Ndakpọ chọrọ ka etinyere ngwa mgbakwunye mgbanwe na ụdị Bootstrap gị.
Pịa bọtịnụ dị n'okpuru iji gosi ma zoo ihe ọzọ site na mgbanwe klaasị:
.collapse
na-ezochi ọdịnaya.collapsing
etinyere n'oge mgbanwe.collapse.in
na-egosi ọdịnayaỊ nwere ike iji njikọ nwere href
njirimara, ma ọ bụ bọtịnụ nwere data-target
àgwà ahụ. N'okwu abụọ a, data-toggle="collapse"
achọrọ ya.
Gbatịkwuo omume ndakpọ ndabara iji mepụta accordion na akụkụ panel.
Ọ dịkwa ike iji s gbanwee .panel-body
s .list-group
.
Jide n'aka na ị ga-agbakwunye aria-expanded
na ihe njikwa. Njirimara a na-akọwa n'ụzọ doro anya ọnọdụ ugbu a nke ihe nwere ike ịdaba na ndị na-agụ ihuenyo na teknụzụ enyemaka yiri ya. Ọ bụrụ na ejiri ndabara mechie mmewere nwere ike ịdaba, ọ kwesịrị inwe uru nke aria-expanded="false"
. Ọ bụrụ na ịtọọla mmewere enwere ike imeghe site na ndabara site na iji in
klas, tọọ aria-expanded="true"
na njikwa kama. Ngwa mgbakwunye ahụ ga-agbanwe àgwà a na-akpaghị aka dabere na emeghere ma ọ bụ mechie mmewere nke nwere ike imebi ma ọ bụ na emeghị ya.
Na mgbakwunye, ọ bụrụ na ihe njikwa gị na-ezubere iche maka otu mmewere nwere ike imebi - ya bụ data-target
njirimara na-atụ aka na onye id
nhọpụta - ị nwere ike itinye mgbakwunye mgbakwunye aria-controls
na mmewere njikwa, nwere ihe nwere id
ike ịdaba. Ndị na-agụ ihuenyo ọgbara ọhụrụ na teknụzụ enyemaka ndị yiri ya na-eji njirimara a nye ndị ọrụ ụzọ mkpirisi agbakwunyere iji gaa ozugbo na mmewere nwere ike ịdaba n'onwe ya.
Ngwa mgbakwunye ndakpọ na-eji klaasị ole na ole iji jikwaa ibuli elu:
.collapse
na-ezochi ọdịnaya.collapse.in
na-egosi ọdịnaya.collapsing
a na-agbakwụnye mgbe mgbanwe ahụ malitere, ma wepụ ya mgbe ọ gwụcharaEnwere ike ịchọta klas ndị a na component-animations.less
.
Naanị tinye data-toggle="collapse"
na a data-target
na mmewere iji nye njikwa nke mmewere nwere ike ịdaba na-akpaghị aka. Àgwà ahụ data-target
na-anabata onye nhọpụta CSS iji tinye ọdịda ahụ. Jide n'aka na ịtinye klas collapse
ahụ na mmewere nwere ike ịdaba. Ọ bụrụ na ị ga-achọ ka ọ meghee, tinye klaasị agbakwunyere in
.
Ka ịgbakwunye njikwa otu accordion dị ka njikwa nwere ike imebi, tinye njirimara data data-parent="#selector"
. Rụtụ aka na ngosi ngosi ka ịhụ nke a na-arụ ọrụ.
Jiri aka jiri:
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-parent=""
.
Aha | ụdị | ndabara | nkọwa |
---|---|---|---|
nne na nna | onye nhọpụta | ụgha | Ọ bụrụ na enyere onye nhọpụta, a ga-emechi ihe niile nwere ike ịdaba n'okpuru nne na nna akọwapụtara mgbe egosiri ihe a nwere ike ịdaba. (dị ka omume accordion ọdịnala - nke a dabere na panel klaasị) |
tụgharịa | boolean | eziokwu | Na-atụgharị ihe nwere ike ịdaba na oku |
.collapse(options)
Na-eme ka ọdịnaya gị rụọ ọrụ ka ihe nwere ike imebi. Nabata nhọrọ nhọrọ object
.
.collapse('toggle')
Na-atụgharị ihe nwere ike ịdaba ka egosiri ma ọ bụ zoo. Na-alaghachikwute onye na-akpọ oku tupu egosiri ma ọ bụ zoo ihe nwere ike ịdaba (ya bụ tupu ihe omume shown.bs.collapse
ma ọ bụ hidden.bs.collapse
emee).
.collapse('show')
Na-egosi mmewere nwere ike ịdaba. Na-alaghachikwute onye na-akpọ oku tupu egosipụta mmewere nwere ike ịdaba (ya bụ tupu shown.bs.collapse
mmemme emee).
.collapse('hide')
Na-ezobe mmewere nwere ike ịdaba. Na-alaghachikwute onye na-akpọ oku tupu ezobe ihe omume nwere ike ịdaba (ya bụ, tupu ihe hidden.bs.collapse
omume emee).
Klas ndakpọ Bootstrap na-ekpughe ihe omume ole na ole maka itinye aka n'ọrụ ọdịda.
Ụdị mmemme | Nkọwa |
---|---|
gosi.bs.dakpu | Ihe omume a na-agba ọkụ ozugbo show a na-akpọ usoro ihe atụ. |
egosiri.bs.dakpọ | A na-agbanyụ mmemme a mgbe onye ọrụ mere ka ihe ndakpọ pụtara (ga-echere mgbanwe CSS ka agwụchaa). |
zoo.bs.dakpu | A na-agbapụ ihe omume a ozugbo mgbe hide a na-akpọ usoro ahụ. |
zoro ezo.bs.dakpu | A na-agbapụ mmemme a mgbe ezoro ezoro onye ọrụ ihe ndakpọ (ga-echere mgbanwe CSS ka agwụchaa). |
Ngwa ihe ngosi mmịfe maka ịgba ígwè site na ihe ndị dị ka carousel. A naghị akwado carousels akwụkwụ.
Akụkụ carousel anaghị akwado ụkpụrụ nnweta. Ọ bụrụ na ịchọrọ ịkwado, biko tụlee nhọrọ ndị ọzọ maka igosipụta ọdịnaya gị.
Bootstrap na-eji naanị CSS3 maka eserese ya, mana Internet Explorer 8 & 9 anaghị akwado akụrụngwa CSS dị mkpa. Ya mere, ọ dịghị ihe nkiri mgbanwe slide mgbe ị na-eji ihe nchọgharị ndị a. Anyị kpachaara anya kpebie na anyị agaghị etinye ndaghachi azụ dabere jQuery maka ntụgharị.
Ekwesịrị .active
ịgbakwunye klas ahụ n'otu n'ime ihe mmịfe ahụ. Ma ọ bụghị ya, carousel agaghị ahụ anya.
The .glyphicon .glyphicon-chevron-left
na .glyphicon .glyphicon-chevron-right
klaasị na ọ bụchaghị mkpa maka njikwa. Bootstrap na-enye .icon-prev
yana .icon-next
dị ka ụzọ unicode doro anya.
Tinye nkọwa okwu na slide gị n'ụzọ dị mfe na .carousel-caption
mmewere dị n'ime nke ọ bụla .item
. Debe naanị HTML nhọrọ ọ bụla n'ime ebe ahụ, a ga-ahazi ya ozugbo wee hazie ya.
Carousels na-achọ ka iji ihe id
dị n'elu akpa (nke .carousel
) maka njikwa carousel na-arụ ọrụ nke ọma. Mgbe ị na-agbakwunye ọtụtụ carousels, ma ọ bụ mgbe ị na-agbanwe carousel's id
, jide n'aka na imelite njikwa ndị dị mkpa.
Jiri njirimara data iji jikwaa ọnọdụ carousel ngwa ngwa. data-slide
na-anabata mkpụrụokwu prev
ma ọ bụ next
, nke na-agbanwe ọnọdụ slide dabere na ọnọdụ ya ugbu a. N'aka nke ọzọ, jiri data-slide-to
iji nyefee akara ngosi mmịfe raw na carousel data-slide-to="2"
, nke na-atụgharị ọnọdụ mmịfe ahụ gaa n'otu ndeksi malite na 0
.
A data-ride="carousel"
na-eji njirimara ahụ akara carousel ka ọ na-amalite na ibu ibe. Enweghị ike iji ya na (nke na-adịghị mkpa na enweghị isi) mmalite Javascript doro anya nke otu carousel.
Jiri aka kpọọ carousel:
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-interval=""
.
Aha | ụdị | ndabara | nkọwa |
---|---|---|---|
etiti oge | nọmba | 5000 | Ogologo oge igbu oge n'etiti ịnya igwe na-akpaghị aka. Ọ bụrụ na ụgha, carousel agaghị agba okirikiri na-akpaghị aka. |
kwụsịtụ | eriri | efu | "hover" | Ọ bụrụ na ịtọ ya "hover" , kwụsịtụ ịgba ígwè nke carousel mouseenter ma maliteghachi ịgba ígwè nke carousel na mouseleave . Ọ bụrụ na ịtọ ya null , ịfegharị n'elu carousel agaghị akwụsịtụ ya. |
kechie | boolean | eziokwu | Ma carousel kwesịrị ịnya okirikiri ma ọ bụ nwee nkwụsị siri ike. |
ahụigodo | boolean | eziokwu | Ma carousel kwesịrị imeghachi omume na mmemme ahụigodo. |
.carousel(options)
Na-ebute carousel na nhọrọ nhọrọ object
wee malite ịnya igwe site na ihe.
.carousel('cycle')
Na-agagharị na ihe carousel site n'aka ekpe gaa n'aka nri.
.carousel('pause')
Na-akwụsị carousel site n'ịgba ígwè na ihe.
.carousel(number)
Na-eme okirikiri carousel gaa n'otu etiti (0 dabere, yiri n'usoro).
.carousel('prev')
Ọkpụkpụ gaa na ihe gara aga.
.carousel('next')
Chọgharịa gaa na ihe na-esote.
Klas carousel Bootstrap na-ekpughe ihe omume abụọ maka itinye aka na ọrụ carousel.
Ihe omume abụọ a nwere ihe mgbakwunye ndị a:
direction
: Ntuziaka nke carousel na-amị amị (ma "left"
ọ bụ "right"
).relatedTarget
: Ihe DOM nke a na-agbanye n'ime ebe dị ka ihe na-arụ ọrụ.A na-agbapụ ihe omume carousel niile na carousel n'onwe ya (ya bụ na <div class="carousel">
).
Ụdị mmemme | Nkọwa |
---|---|
slide.bs.carousel | Ihe omume a na-agba ọkụ ozugbo slide a kpọkuru usoro ihe atụ. |
slid.bs.carousel | A na-agbapụ ihe omume a mgbe carousel mechachara mgbanwe slide ya. |
Ihe mgbakwunye affix position: fixed;
na-agbanye ma gbanyụọ, na-eṅomi mmetụta ahụrụ na position: sticky;
. The subnavigation n'aka nri bụ a ndụ ngosi nke affix plugin.
Jiri ngwa mgbakwunye affix site na njirimara data ma ọ bụ jiri aka gị jiri Javascript nke gị. N'ọnọdụ abụọ a, ị ga-enwerịrị CSS maka ndowe na obosara nke ọdịnaya gị etinyere.
Mara: Ejila ngwa mgbakwunye affix na mmewere dị n'ime ihe edobere dịtụ, dị ka kọlụm dọtara ma ọ bụ kpalie, n'ihi ahụhụ na-enye Safari .
Ngwa mgbakwunye a na-atụgharị n'etiti klaasị atọ, nke ọ bụla na-anọchi anya otu steeti: .affix
, .affix-top
, na .affix-bottom
. Ị ga-enyerịrị ụdị ahụ, ewezuga position: fixed;
na .affix
, maka klaasị ndị a n'onwe gị (na-adabere na ngwa mgbakwunye a) iji jikwaa ọnọdụ ndị ahụ.
Nke a bụ ka ngwa mgbakwunye affix si arụ ọrụ:
.affix-top
iji gosi mmewere nọ n'ọnọdụ ya kachasị elu. N'ebe a, ọ dịghị mkpa idowe CSS..affix
edochiri .affix-top
na ịtọọ position: fixed;
(nke Bootstrap's CSS nyere)..affix
iji .affix-bottom
. Ebe ọ bụ na akwụghị ụgwọ bụ nhọrọ, ịtọ otu chọrọ ka ịtọọ CSS kwesịrị ekwesị. N'okwu a, gbakwunye position: absolute;
mgbe ọ dị mkpa. Ngwa mgbakwunye ahụ na-eji njirimara data ma ọ bụ nhọrọ Javascript iji chọpụta ebe a ga-etinye mmemme site na ebe ahụ.Soro usoro ndị a dị n'elu ka ịtọọ CSS gị maka otu nhọrọ ojiji dị n'okpuru.
Ka ịgbakwunye omume affix ngwa ngwa na mmewere ọ bụla, tinye naanị data-spy="affix"
na mmewere ịchọrọ iledo. Jiri nkwụghachi iji kọwaa mgbe ị ga-atụgharị pinning nke mmewere.
Kpọọ ngwa mgbakwunye affix 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-offset-top="200"
.
Aha | ụdị | ndabara | nkọwa |
---|---|---|---|
nkwụsị | nọmba | ọrụ | ihe | 10 | Pikselụ ka a ga-ewepụ site na ihuenyo mgbe ị na-agbakọ ọnọdụ mpịakọta. Ọ bụrụ na enyere otu nọmba, a ga-etinye nkwụghachi ahụ n'akụkụ ma n'elu na n'okpuru. Iji wepụta ihe pụrụ iche, nkwụghachi ala na elu dị nnọọ nye ihe offset: { top: 10 } ma ọ bụ offset: { top: 10, bottom: 5 } . Jiri ọrụ mgbe ịchọrọ ịgbakọ nkwụghachi n'ike. |
iche | onye nhọpụta | ọnụ | jQuery element | window ihe _ |
Na-akọwapụta ebumnuche ebumnuche nke affix. |
.affix(options)
Na-eme ka ọdịnaya gị rụọ ọrụ dị ka ọdịnaya etinyere. Nabata nhọrọ nhọrọ object
.
.affix('checkPosition')
Na-atụgharị ọnọdụ nke affix dabere na nha, ọnọdụ, na ọnọdụ mpịakọta nke ihe ndị dị mkpa. A na-agbakwunye .affix
, .affix-top
, na .affix-bottom
klaasị na ma ọ bụ wepụ ya na ọdịnaya etinyere dịka steeti ọhụrụ ahụ siri dị. Ekwesịrị ịkpọ usoro a mgbe ọ bụla agbanwere akụkụ nke ọdịnaya etinyere ma ọ bụ ihe ebumnuche, iji hụ na edobere ọdịnaya etinyere nke ọma.
Ngwa mgbakwunye Bootstrap na-ekpughe ihe omume ole na ole maka itinye aka na arụ ọrụ mgbakwunye.
Ụdị mmemme | Nkọwa |
---|---|
affix.bs.affix | Ihe omume a na-agba ọkụ ozugbo tupu etinyere ihe ahụ. |
agbakwunyere.bs.affix | A na-achụpụ ihe omume a mgbe etinyechara ihe ahụ. |
affix-top.bs.affix | Ihe omume a na-agba ọkụ ozugbo tupu etinyere ihe ahụ-elu. |
agbakwunyere-elu.bs.affix | A na-achụpụ ihe omume a mgbe etinyechara ihe ahụ n'elu. |
affix-bottom.bs.affix | Ihe omume a na-agba ọkụ ozugbo tupu etinyere ihe ahụ n'okpuru. |
agbakwunyere-ala.bs.affix | A na-achụpụ ihe omume a mgbe etinyechara ihe ahụ n'okpuru. |