Weta ngwa Bootstrap na ndụ-ugbu a nwere ngwa mgbakwunye jQuery omenala iri na atọ.
Enwere ike itinye ngwa mgbakwunye n'otu n'otu (n'agbanyeghị ụfọdụ chọrọ ịdabere), ma ọ bụ ha niile otu oge. Abụọ bootstrap.js na bootstrap.min.js nwere plugins niile n'otu faịlụ.
Ị 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 na iwepu ihe omume niile dị na aha ahụ nke ejiri ''data-api''. Nke a dị ka nke a:
- $ ( 'ahụ' ). gbanyụọ ( '.data-api' )
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:
- $ ( 'ahụ' ). gbanyụọ ( '.alert.data-api' )
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.
- $ ( ".btn.danger" ). bọtịnụ ( "ịtụgharị" ). addClass ( "abụba" )
Ụ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):
- $ ( "#myModal" ). modal () // jiri ndabara malite ya
- $ ( "#myModal" ). modal ({ ahụigodo : ụgha }) // ibido na enweghị ahụigodo
- $ ( "#myModal" ). modal ( 'show' ) // na-ebido na ịkpọku ihe ngosi ozugbo
Ngwa mgbakwunye ọ bụla na-ekpughekwa ihe nrụpụta 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')
.
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.
- var bootstrapButton = $ . fn . bọtịnụ . noConflict () // weghachi $.fn.bọtịnụ na uru ekenyere mbụ
- $ . fn . bootstrapBtn = bootstrapButton // nye $() .bootstrapBtn arụmọrụ bootstrap.
Bootstrap na-enye mmemme omenala maka ọtụtụ mmemme pụrụ iche nke ngwa mgbakwunye. N'ozuzu, ndị a na-abịa na njedebe 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.
Ihe omume enweghị ngwụcha na-enye ọrụ mgbochi ndabara. Nke a na-enye ikike ịkwụsị mmezu nke ihe tupu ya amalite.
- $ ( '#myModal' ). na ( 'show' , ọrụ ( e ) {
- ọ bụrụ (! data ) laghachi e . preventDefault () // akwụsị modal igosi
- })
Maka mmetụta mgbanwe dị mfe, gụnyere bootstrap-transition.js otu ugboro n'akụkụ faịlụ JS ndị ọzọ. Ọ bụrụ na ị na-eji chịkọtara (ma ọ bụ miniified) bootstrap.js , ọ dịghị mkpa ịgụnye nke a-ọ dịlarị.
Ọmụmaatụ ole na ole nke ngwa mgbakwunye mgbanwe:
A na-ahazi usoro, mana na-agbanwe agbanwe, na-akpalite mkparịta ụka na arụrụ ọrụ kacha nta achọrọ yana ndabara smart.
Modal emepụtara nwere nkụnye eji isi mee, ahụ, na usoro omume n'okpuru ụkwụ.
Otu anụ ahụ mara mma…
- <div class = "modal hide fade" >
- <div class = "modal-header" >
- < ụdị bọtịnụ = "bọtịnụ" klaasị = "emechi" data-dismiss = "modal" aria-hidden = "eziokwu" > & ugboro; </bọtịnụ>
- <h3> Ihe nkụnye eji isi mee </h3>
- </div>
- <div klas = "modal-body" >
- <p> Otu ahụ mara mma… </p>
- </div>
- <div class = "modal-footer" >
- <a href = "#" klaasị = "btn"> Mechie </a> _
- <a href = "#" klas = "btn btn-primary" > Chekwa mgbanwe </a>
- </div>
- </div>
Gbanwee modal site na JavaScript site na ịpị bọtịnụ dị n'okpuru. Ọ ga-adaba ma daa site n'elu ibe ahụ.
- <!-- bọtịnụ iji kpalite modal -->
- <a href = "#myModal" ọrụ = "bọtịnụ" klas = "btn" data-toggle = "modal" > Mwepụta ngosi modal </a>
- <!-- Modal -->
- <div id = "myModal" klas = "modal hide fade" tabindex = "-1" ọrụ = "dialog" aria-labelledby = "myModalLabel" aria-hidden = "eziokwu" >
- <div class = "modal-header" >
- < ụdị bọtịnụ = "bọtịnụ" klaasị = "emechi" data-dismiss = "modal" aria-hidden = "eziokwu" > × </button>
- <h3 id = "myModalLabel" > Ntụnye modal </h3>
- </div>
- <div klas = "modal-body" >
- <p> Otu ahụ mara mma… </p>
- </div>
- <div class = "modal-footer" >
- <button class = "btn" data-dismiss = "modal" aria-hidden = "eziokwu" > Mechie </button>
- <button class = "btn btn-primary" > Chekwa mgbanwe </button>
- </div>
- </div>
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.
- <button type = "bọtịnụ" data-toggle = "modal" data-target = "#myModal" > Mwepụta modal </button>
Kpọọ modal nwere id myModal
nwere otu ahịrị Javascript:
- $ ( '#myModal' ). modal ( nhọrọ )
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 | 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 | Ọ bụrụ na ewepụtara url dịpụrụ adịpụ, a ga-ebuba ọdịnaya site na
|
Na-eme ka ọdịnaya gị rụọ ọrụ dị ka modal. Nabata nhọrọ nhọrọ object
.
- $ ( '#myModal' ). modal ({
- ahụigodo : ụgha
- })
Iji aka na-atụgharị modal.
- $ ( '#myModal' ). modal ( 'ntụgharị' )
Iji aka na-emepe modal.
- $ ( '#myModal' ). modal ( 'show' )
Iji aka na-ezo modal.
- $ ( '#myModal' ). modal ( 'zoo' )
Klas modal Bootstrap na-ekpughe ihe omume ole na ole maka ịbanye n'ime ọrụ modal.
Ihe omume | Nkọwa |
---|---|
gosi | Ihe omume a na-agba ọkụ ozugbo show a na-akpọ usoro ihe atụ. |
egosiri | A na-achụpụ ihe omume a mgbe onye ọrụ mere ka modal ahụ anya (ga-echere ntụgharị css ka agwụchaa). |
zoo | A na-agbapụ ihe omume a ozugbo hide a kpọrọ usoro ihe atụ. |
zoro ezo | A na-achụpụ ihe omume a mgbe ezoro ezoro ya n'aka onye ọrụ modal (ga-echere mgbanwe css iji wuchaa). |
- $ ( '#myModal' ). na ( 'zoro ezo' , ọrụ () {
- // mee ihe…
- })
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ụ.
Tinye data-toggle="dropdown"
na njikọ ma ọ bụ bọtịnụ ka ịgbanwee mkpọda.
- <div klas = "mkpọda" >
- <a class = "dropdown-toggle" data-toggle = "dropdown" href = "#" > Mbudata </a>
- <ul class = "nchịkọta-nchịkọta-n'ala " ọrụ = "menu" aria-labelledby = "dLabel" >
- ...
- </ul>
- </div>
Iji dobe URL adịghị, jiri data-target
njirimara kama href="#"
.
- <div klas = "mkpọda" >
- <a class = "dropdown-toggle" id = "dLabel" ọrụ = "bọtịnụ" data-toggle = "dobe" data-target = "#" href = "/page.html" >
- Wedaa
- <b klas = "nlekọta" </b>
- </a>
- <ul class = "nchịkọta-nchịkọta-n'ala " ọrụ = "menu" aria-labelledby = "dLabel" >
- ...
- </ul>
- </div>
Kpọọ dropdowns site na Javascript:
- $ ( '.dropdown-toggle' ). dropdown ()
Ọ dịghị
Api mmemme maka ntugharị menus maka ihe navbar enyere ma ọ bụ igodo taabụ.
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.
Ka mfe tinye scrollspy omume gị topbar igodo, dị nnọọ tinye data-spy="scroll"
na mmewere ị chọrọ inyocha na (kasị a ga-abụ ahụ) na data-target=".navbar"
họrọ nke nav iji. Ị ga-achọ iji scrollspy nwere .nav
akụrụngwa.
- <body data-spy = "mpịakọta" data-target = ".navbar" > ... </ body>
Kpọọ scrollspy site na Javascript:
- $ ( '#navbar' ). scrollspy ()
<a href="#home">home</a>
ga-ederịrị ihe n'ime ụlọ dịka
<div id="home"></div>
.
Mgbe ị na-eji scrollspy yana mgbakwunye ma ọ bụ wepụ ihe ndị sitere na DOM, ị ga-akpọ usoro ume ọhụrụ dị ka:
- $ ( '[data-spy="mpịakọta"]' ). nke ọ bụla ( ọrụ () {
- var $ nledo = $ ( nke a ). scrollspy ( 'refresh' )
- }
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. |
Ihe omume | Nkọwa |
---|---|
rụọ ọrụ | 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ọ.
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 tupu ha erere master cleanse gluten-free squid scenester freegan cosby sweta. Fanny pack portland seitan DIY, nka party locavore wolf cliche high life echo park Austin. Cred vinyl keffiyeh DIY salvia PBR, banh mi tupu ha erere ugbo-na-tebulu VHS viral locavore cosby sweta. ꞌYị ga bɨ ṇguṇgunɨ́ ledre ꞌbɨ Lomo go, zɨ́a úku úku ledre zɨ́a útúásáne keffiye kị́éꞌdo kị́éꞌdo káa zɨ́ bɨlámáne. Wolf salvia freegan, sartorial keffiyeh echo park vegan.
Kwado taabụ tabbable site na Javascript (taabụ ọ bụla kwesịrị ịgbalite n'otu n'otu):
- $ ( '#myTab a' ). pịa ( ọrụ ( e ) {
- e . mgbochiDedfault ();
- $ ( nke a ). tab ( 'show' );
- })
Ị nwere ike ịgbalite taabụ n'otu n'otu n'ụzọ dị iche iche:
- $ ( '#myTab a[href="#profile"]' ). tab ( 'show' ); // Họrọ taabụ n'aha
- $ ( '#myTab a: nke mbụ' ). tab ( 'show' ); // Họrọ taabụ mbụ
- $ ( '#myTab a: ikpeazụ' ). tab ( 'show' ); // Họrọ taabụ ikpeazụ
- $ ( '#myTab li: eq(2) a' ). tab ( 'show' ); // Họrọ taabụ nke atọ (0-indexed)
Ị 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. Ịtinye nav
na nav-tabs
klaasị na taabụ ul
ahụ ga-etinye nhazi taabụ Bootstrap.
- <ul klas = "nav nav-tabs" >
- <li><a href = "#home" data-toggle = "taabụ" > Ụlọ </a></li>
- <li><a href = "#profile" data-toggle = "taabụ" > Profaịlụ </a></li>
- <li><a href = "#messages" data-toggle = "taabụ" > Ozi </a></li>
- <li><a href = "#settings" data-toggle = "taabụ" > Ntọala </a></li>
- </ul>
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.
- <ul klas = "nav nav-tabs" id = "myTab" >
- <li class = "ọrụ" ><a href = "#ụlọ" > Ụlọ </a></li>
- <li><a href = "#profile" > Profaịlụ </a></li>
- <li><a href = "#messages" > Ozi </a></li>
- <li><a href = "#settings" > Ntọala </a></li>
- </ul>
- <div class = "taabụ-ọdịnaya" >
- <div class = "tab-pane active" id = "ụlọ" > ... </div>
- <div class = "tab-pane" id = "profaịlụ" > ... </div>
- <div class = "tab-pane" id = "ozi" > ... </div>
- <div class = "tab-pane" id = "ntọala" > ... </div>
- </div>
- <edemede>
- $ ( ọrụ () {
- $ ( '#myTab a: ikpeazụ' ). tab ( 'show' );
- })
- </script>
Ihe omume | Nkọwa |
---|---|
gosi | 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 | 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. |
- $ ( 'a[data-toggle = "taabụ"]' ). na ( 'gosiri' , ọrụ ( e ) {
- e . target // taabụ arụ ọrụ
- e . metụtaraTarget // taabụ gara aga
- })
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.
Maka ebumnuche arụmọrụ, mpio ngwaọrụ na popover data-apis abanyela, nke pụtara na ị ga-ebido ya n'onwe gị .
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-to-table 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.
Mgbe ị na-eji Tooltips na popovers na otu ntinye Bootstrap, ị ga-edozi container
nhọrọ (ederede n'okpuru) iji zere mmetụta ndị achọghị.
Kpalite ntụnye aka site na Javascript:
- $ ( '#ihe atụ' ). Tooltip ( nhọrọ )
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ị | ndabara | nkọwa |
---|---|---|---|
animation | boolean | eziokwu | tinye mgbanwe css fade na ngwungwu ngwaọrụ |
html | boolean | ụgha | Fanye html n'ime ngwa ọrụ. Ọ bụrụ ụgha, text a ga-eji usoro jquery tinye ọdịnaya n'ime ụlọ. 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 | nri |
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. |
aha | eriri | ọrụ | '' | Uru aha ndabara ma ọ bụrụ na mkpado 'aha' adịghị |
ịkpalite | eriri | 'hover focus' | otú Tooltip si akpalite - pịa | hover | lekwasịrị anya | akwụkwọ ntuziaka. Rịba ama na ikpe gafere na-akpalite mutliple, oghere kewapụrụ, ụdị mkpalite. |
igbu oge | nọmba | ihe | 0 | igbu oge igosi na izobe ngwa ọrụ (ms) - anaghị emetụta ụdị mkpali aka Ọ bụrụ na ewepụtara nọmba, a na-etinye igbu oge na ma zoo/egosi Nhazi ihe bụ: |
akpa | eriri | ụgha | ụgha | Na-agbakwunye ntụnye aka na otu mmewere |
- <a href = "#" data-toggle = "tooltip" aha = "ngwaọrụ izizi" > fesa m </a>
Na-ejikọta onye na-ahụ maka ndụmọdụ ngwaọrụ na mkpokọta mmewere.
Na-ekpughe ngwa ọrụ mmewere.
- $ ( '# element' ). Tooltip ( 'show' )
Na-ezobe ntụaka ngwa ọrụ mmewere.
- $ ( '# element' ). Tooltip ( 'zoo' )
Na-atụgharị ihe ntụnye aka nke mmewere.
- $ ( '# element' ). Tooltip ( 'ntụgharị' )
Na-ezo ma na-ebibi ngwa ọrụ mmewere.
- $ ( '# element' ). Tooltip ( 'bibi' )
Tinye obere ihe machie nke ọdịnaya, dị ka ndị dị na iPad, na ihe ọ bụla maka ozi nke abụọ nke ụlọ. Chekwaa n'elu bọtịnụ iji kpalite popover. Achọrọ ka etinyere ndụmọdụ ngwaọrụ .
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.
Ọnweghị akara egosiri ka ewepụtara popovers site na Javascript yana ọdịnaya dị n'ime data
njirimara.
Kwado popovers site na Javascript:
- $ ( '#ihe atụ' ). popover ( nhọrọ )
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ị | ndabara | nkọwa |
---|---|---|---|
animation | boolean | eziokwu | tinye mgbanwe css fade na ngwungwu ngwaọrụ |
html | boolean | ụgha | Fanye html n'ime popover. Ọ bụrụ ụgha, text a ga-eji usoro jquery tinye ọdịnaya n'ime ụlọ. 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 | nri |
onye nhọpụta | eriri | ụgha | ọ bụrụ na enyere onye nhọpụta, a ga-ekenye ihe ndị ahọpụtara ngwaọrụ na ebumnuche ndị akọwapụtara |
ịkpalite | eriri | 'pịa' | ka esi eme popover - pịa | hover | lekwasịrị anya | akwụkwọ ntuziaka |
aha | eriri | ọrụ | '' | Uru aha ndabara ma ọ bụrụ na àgwà 'aha' adịghị |
ọdịnaya | eriri | ọrụ | '' | uru ọdịnaya ndabara ma ọ bụrụ na njirimara 'data-content' adịghị |
igbu oge | nọmba | ihe | 0 | igbu oge igosi na izobe popover (ms) - anaghị etinye aka na ụdị mkpalite aka Ọ bụrụ na ewepụtara nọmba, a na-etinye igbu oge na ma zoo/egosi Nhazi ihe bụ: |
akpa | eriri | ụgha | ụgha | Na-agbakwunye popover na otu mmewere |
Maka ebumnuche arụmọrụ, Tooltip na Popover data-apis abanyela. Ọ bụrụ na ịchọrọ iji ha naanị ezipụta nhọrọ nhọrọ.
Na-ebute popovers maka mkpokọta mmewere.
Na-ekpughe ihe ngosi popover.
- $ ( '# element' ). popover ( 'show' )
Na-ezobe ihe nchacha mmapụta.
- $ ( '# element' ). popover ( 'zoo' )
Na-atụgharị ihe ndị mejupụtara popover.
- $ ( '# element' ). popover ( 'ntụgharị' )
Na-ezo ma na-ebibi popover nke mmewere.
- $ ( '# element' ). popover ( 'bibi' )
Tinye ọrụ achụpụ na ozi njikere niile na ngwa mgbakwunye a.
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.
Kwado ịchụpụ ọkwa site na Javascript:
- $ ( ".ọhụụ" ). njikere ()
Naanị tinye data-dismiss="alert"
na bọtịnụ mmechi gị iji nye ọrụ nso nsonye na-akpaghị aka.
- <a class = "emechi" data-dismiss = "alert" href = "#" > & ugboro; </a>
Na-eji arụ ọrụ nso kechie ọkwa niile. Iji mee ka ọkwa gị dị ndụ mgbe emechiri emechi, gbaa mbọ hụ na ha etinyelarị ya .fade
na .in
klas ahụ.
Na-emechi mkpu.
- $ ( ".ọhụụ" ). njikere ( 'emechi' )
Klas njikere Bootstrap na-ekpughe ihe omume ole na ole maka ịbanye n'ime ọrụ njikere.
Ihe omume | Nkọwa |
---|---|
nso | Ihe omume a na-agba ọkụ ozugbo close a na-akpọ usoro ihe atụ. |
mechiri emechi | A na-achụpụ ihe omume a mgbe emechiela njikere (ga-echere mgbanwe css ka ọ mezue). |
- $ ( '#my-alert' ). kechie ( 'emechi' , ọrụ () {
- // mee ihe…
- })
Nweta ụdị ntọala yana nkwado na-agbanwe agbanwe maka ihe ndị nwere ike imebi dị ka accordions na igodo.
* Achọrọ ka etinyere ngwa mgbakwunye Transitions.
N'iji ngwa mgbakwunye ọdịda, anyị wuru wijetị ụdị accordion dị mfe:
- <div class = "accordion" id = "accordion2" >
- <div class = "accordion-group" >
- <div class = "accordion-heading" >
- <a class = "accordion-toggle" data-toggle = "collapse" data-parent = "#accordion2" href = "#collapseOne" >
- Otu ihe nwere ike igbakota
- </a>
- </div>
- <div id = "collapseOne" klaasị = "accordion-body dara na" >
- <div class = "accordion-inner" >
- Anim pariatur cliche...
- </div>
- </div>
- </div>
- <div class = "accordion-group" >
- <div class = "accordion-heading" >
- <a class = "accordion-toggle" data-toggle = "collapse" data-parent = "#accordion2" href = "#collapseTwo" >
- Otu ihe nwere ike igbakota
- </a>
- </div>
- <div id = "collapseTwo" klaasị = "accordion-body ọdịda" >
- <div class = "accordion-inner" >
- Anim pariatur cliche...
- </div>
- </div>
- </div>
- </div>
- ...
Ị nwekwara ike iji ngwa mgbakwunye na-enweghị akara accordion. Mee ka bọtịnụ gbanwee ịgbasa na ndakpọ nke ihe ọzọ.
- < ụdị bọtịnụ = "bọtịnụ" klas = "btn btn-danger" data-toggle = "collapse" data-target = "#demo" >
- mfe ndakpọ
- </bọtịnụ>
- <div id = "demo" klaasị = "daba n'ime" > … </div>
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 css ahọpụtara 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:
- $ ( ".dakpọ" ). daa ()
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 ahọpụtara, a ga-emechi ihe niile ga-adakpọ n'okpuru nne na nna akọwapụtara mgbe egosiri ihe a nwere ike ịdaba. (yiri omume accordion omenala) |
tụgharịa | boolean | eziokwu | Na-atụgharị ihe nwere ike ịdaba na oku |
Na-eme ka ọdịnaya gị rụọ ọrụ ka ihe nwere ike imebi. Nabata nhọrọ nhọrọ object
.
- $ ( '#myCollapsible' ). daa ({
- toggle : ụgha
- })
Na-atụgharị ihe nwere ike ịdaba ka egosiri ma ọ bụ zoo.
Na-egosi mmewere nwere ike ịdaba.
Na-ezobe mmewere nwere ike ịdaba.
Klas ndakpọ Bootstrap na-ekpughe ihe omume ole na ole maka itinye aka n'ọrụ ọdịda.
Ihe omume | Nkọwa |
---|---|
gosi | Ihe omume a na-agba ọkụ ozugbo show a na-akpọ usoro ihe atụ. |
egosiri | A na-agbanyụ mmemme a mgbe onye ọrụ mere ka ihe ndakpọ pụtara (ga-echere ntụgharị css ka agwụchaa). |
zoo | A na-agbapụ ihe omume a ozugbo mgbe hide a na-akpọ usoro ahụ. |
zoro ezo | A na-agbanyụ mmemme a mgbe ezonarila ihe ndakpọ n'aka onye ọrụ (ga-echere ntụgharị css ka emechaa). |
- $ ( '#myCollapsible' ). na ( 'zoro ezo' , ọrụ () {
- // mee ihe…
- })
Ihe ngosi mmịfe dị n'okpuru na-egosi ngwa mgbakwunye ọnụọgụ yana akụrụngwa maka ịgba ígwè site na ihe dị ka carousel.
- <div id = "myCarousel" klas = "carousel slide" >
- <ol klas = "carousel-egosi" >
- <li data-target = "#myCarousel" data-slide-to = "0" klas = "arụ ọrụ" </li>
- <li data-target = "#myCarousel" data-slide-to = "1" ></li>
- <li data-target = "#myCarousel" data-slide-to = "2" ></li>
- </ol>
- <!-- Ihe carousel -->
- <div klas = "carousel-inner" >
- <div class = "ihe na-arụ ọrụ" > … </div>
- <div class = "ihe" > … </div>
- <div class = "ihe" > … </div>
- </div>
- <!-- Carousel nav -->
- <a class = "carousel-control left" href = "#myCarousel" data-slide = "prev" > ‹ </a>
- <a class = "carousel-control right" href = "#myCarousel" data-slide = "na-esote" > & rsaquo; </a>
- </div>
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ụ mmịfe n'akụkụ ọ dị ugbu a. N'aka nke ọzọ, jiri data-slide-to
nyefee ndeksi mmịfe raw na carousel data-slide-to="2"
, nke na-awụli elu na ọnọdụ mmịfe gaa n'otu ndeksi malite na 0
.
Jiri aka kpọọ carousel:
- $ ( '.carousel' ). carousel ()
Enwere ike gafere nhọrọ site na njirimara data ma ọ bụ JavaScriptz. 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 | "hover" | Na-akwụsị ịgba ígwè nke carousel na mouseenter ma maliteghachi ịgba ígwè nke carousel na leave òké. |
Na-ebute carousel na nhọrọ nhọrọ object
wee malite ịnya igwe site na ihe.
- $ ( '.carousel' ). carousel ({
- Ogologo oge : 2000
- })
Na-agagharị na ihe carousel site n'aka ekpe gaa n'aka nri.
Na-akwụsị carousel site n'ịgba ígwè na ihe.
Na-eme okirikiri carousel gaa n'otu etiti (0 dabere, yiri n'usoro).
Ọkpụkpụ gaa na ihe gara aga.
Chọgharịa gaa na ihe na-esote.
Klas carousel Bootstrap na-ekpughe ihe omume abụọ maka itinye aka na ọrụ carousel.
Ihe omume | Nkọwa |
---|---|
slide | Ihe omume a na-agba ọkụ ozugbo slide a kpọkuru usoro ihe atụ. |
slide | A na-agbapụ ihe omume a mgbe carousel mechachara mgbanwe slide ya. |
Ngwa mgbakwunye bụ isi, gbatịpụrụ ngwa ngwa maka imepụta ụdị ụdịdị mara mma na ntinye ederede ọ bụla.
- < ụdị ntinye = "ederede" data-provide = "ụdị isi" >
Ị ga-achọ ịtọọ autocomplete="off"
ka igbochi menu ihe nchọgharị ndabara ka ọ pụta n'elu mwụda ụdịdị Bootstrap.
Tinye njirimara data iji debanye aha ihe mmewere nwere ọrụ typeahead dị ka egosiri na ihe atụ dị n'elu.
Jiri aka were kpọọ typeahead:
- $ ( '.typehead' ). typeahead ()
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-source=""
.
Aha | ụdị | ndabara | nkọwa |
---|---|---|---|
isi iyi | n'usoro, ọrụ | [] | Isi mmalite data iji jụọ ajụjụ megide. Nwere ike ịbụ n'usoro nke eriri ma ọ bụ ọrụ. A na-agafe arụmụka abụọ, query uru dị na mpaghara ntinye na process oku azụ. Enwere ike iji ọrụ a n'otu oge site na iweghachite isi data ozugbo ma ọ bụ n'otu oge site na process otu arụmụka azụghachi azụ. |
ihe | nọmba | 8 | Ọnụ ọgụgụ kacha elu nke ihe ga-egosipụta na ndọpụta. |
Ogologo nkeji | nọmba | 1 | Ogologo agwa kacha nta achọrọ tupu ịkpalite ntụnye akpaghị aka |
onye nkwutọ | ọrụ | ikpe enweghị mmetụta | Usoro eji achọpụta ma ajụjụ ọ dabara otu ihe. Nabata otu arụmụka, item nke a ga-anwale ajụjụ a. Nweta ajụjụ ugbu a na this.query . Weghachite boolean true ma ọ bụrụ na ajụjụ bụ egwuregwu. |
nhazi | ọrụ | kpomkwem egwuregwu, ikpe nwere mmetụta, enweghị mmetụta |
Usoro eji hazie nsonaazụ akpaaka. Nabata otu arụmụka items ma nwee oke nke ihe atụ typeahead. Tụtụ aka n'ajụjụ dị ugbu a na this.query . |
emelite | ọrụ | weghachi ihe ahọpụtara | Usoro eji weghachi ihe ahọpụtara. Nabata otu arụmụka, item ma nwee oke nke ihe atụ typeahead. |
highlighter | ọrụ | na-akọwapụta egwuregwu ndabara niile | Usoro eji eme ka ọ pụta ìhè nsonaazụ akpaaka. Nabata otu arụmụka item ma nwee oke nke ihe atụ typeahead. Kwesịrị ịlaghachi html. |
Na-ebute ntinye n'isi n'isi.
The subnavigation n'aka ekpe bụ a ndụ ngosi nke affix plugin.
Ka ịgbakwunye omume affix ngwa ngwa na mmewere ọ bụla, tinye naanị data-spy="affix"
na mmewere ịchọrọ iledo. Mgbe ahụ, jiri offsets kọwapụta mgbe ị ga-atụgharị pinning nke mmewere ma gbanye ma gbanyụọ.
- <div data-spy = "affix" data-offset-top = "200" > ... </div>
affix
,
affix-top
, na
affix-bottom
. Cheta ịlele maka nne ma ọ bụ nna nwere ike daa mgbe mgbakwunye a na-amalite ka ọ na-ewepụ ọdịnaya site na ọsọ nke ibe.
Kpọọ ngwa mgbakwunye affix site na Javascript:
- $ ( '#navbar' ). tinye ()
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ụ abụọ na elu na aka ekpe. Ka ige ntị maka otu ntụzịaka, ma ọ bụ ọtụtụ nkwụsị pụrụ iche, nye naanị ihe offset: { x: 10 } . Jiri ọrụ mgbe ịchọrọ ịnye nkwụghachi ike (ọ bara uru maka ụfọdụ atụmatụ na-anabata). |