Yenza izingxenye ze-Bootstrap ziphile—manje enama- plugin e- jQuery ngokwezifiso ayi-12.
I-plugin ehlelekile, kodwa evumelana nezimo, ithatha i-plugin evamile ye-javascript enobuncane obuncane bokusebenza obudingekayo kanye nokuzenzakalelayo okuhlakaniphile.
Engeza amamenyu okwehlayo cishe kunoma yini ku-Bootstrap ngale plugin elula. I-Bootstrap inokusekelwa okugcwele kwemenyu eyehlayo ku-navbar, amathebhu, namaphilisi.
Sebenzisa i-scrollspy ukuze ubuyekeze ngokuzenzakalelayo izixhumanisi ku-navbar yakho ukuze ubonise isixhumanisi esisebenzayo samanje esisekelwe endaweni yokuskrola.
Sebenzisa le plugin ukuze wenze amathebhu namaphilisi asebenziseke kakhulu ngokuwavumela ukuthi aguqule kumafasitelana amathebhu okuqukethwe kwasendaweni.
Ukuthatha okusha kwe-plugin ye-jQuery Tipsy, Amathuluzi awanciki ezithombeni—asebenzisa i-CSS3 ukuze agxumeke kanye nezibaluli zedatha zokulondoloza isihloko sendawo.
Engeza izimbondela ezincane zokuqukethwe, njengalezo eziku-iPad, kunoma iyiphi into ukuze uthole ulwazi lwesibili lwezindlu.
* Idinga Amathuluzi Amathuluzi ukuthi afakwe
I-plugin yesixwayiso iyikilasi elincane lokwengeza ukusebenza okuseduze kuzaziso.
Yenza okwengeziwe ngezinkinobho. Inkinobho yokulawula ithi noma dala amaqembu ezinkinobho zezingxenye ezengeziwe njengamabha wamathuluzi.
Thola izitayela eziyisisekelo nosekelo oluguquguqukayo lwezingxenye ezigoqekayo njengama-accordion nokuzulazula.
Dala i-merry-go-round yanoma yikuphi okuqukethwe ofisa ukukunikeza umbukiso wesilayidi osebenzayo wokuqukethwe.
I-plugin eyisisekelo, enwetshwe kalula yokudala ngokushesha ama-typehead amahle nganoma iyiphi indlela yokufaka umbhalo.
Ukuze uthole imiphumela elula yoguquko, faka i-bootstrap-transition.js kanye ukuze uslayide kumamodeli noma ucime izexwayiso.
* Iyadingeka ukuze kugcwaliswe ama-plugin
I-plugin ehlelekile, kodwa evumelana nezimo, ithatha i-plugin evamile ye-javascript enobuncane obuncane bokusebenza obudingekayo kanye nokuzenzakalelayo okuhlakaniphile.
Landa ifayelaNgezansi kunemodeli enikezwe ngokwezibalo.
Umzimba owodwa omuhle…
Guqula i-modal usebenzisa i-javascript ngokuchofoza inkinobho engezansi. Izoshelela phansi bese ifiphala kusukela phezulu kwekhasi.
Yethula imodeli yedemoShayela i-modal nge-javascript:
- $ ( '#myModal' ). imodeli ( izinketho )
Igama | uhlobo | okuzenzakalelayo | incazelo |
---|---|---|---|
okwasemuva | boolean | iqiniso | Kufaka phakathi i-elementi ye-modal-backdrop. Noma, cacisa static okwasemuva okungavali i-modal lapho uchofozwa. |
ikhibhodi | boolean | iqiniso | Ivala i-modal lapho ukhiye we-escape ucindezelwa |
umbukiso | boolean | iqiniso | Ibonisa i-modal lapho iqaliswa. |
Ungavula amamodali ekhasini lakho kalula ngaphandle kokuthi ubhale umugqa owodwa we-javascript. Vele usethe data-toggle="modal"
into yesilawuli eno- data-target="#foo"
noma href="#foo"
ehambisana ne-id ye-modal element, futhi uma uchofozwa, izokwethula i-modal yakho.
Futhi, ukuze ungeze izinketho kusibonelo sakho se-modal, vele uzifake njengezibaluli zedatha eyengeziwe kusici sokulawula noma umaki we-modal ngokwawo.
- <a class = "btn" data-toggle = "modal" href = "#myModal" > Yethula Indlela </a>
- <div class = "modal hide" id = "myModal" >
- <div class = "modal-header" >
- <button type = "button" class = "close" data-dismiss = "modal" > × </button>
- <h3> Unhlokweni we-Modal </h3>
- </div>
- <div class = "modal-body" >
- <p> Umzimba owodwa omuhle… </p>
- </div>
- <div class = "modal-footer" >
- <a href = "#" class = "btn" data-dismiss = "modal"> Vala </a> _
- <a href = "#" class = "btn btn-primary" > Londoloza izinguquko </a>
- </div>
- </div>
.fade
iklasi
entweni .modal
(bheka idemo ukuze ubone lokhu kusebenza) futhi ufake i-bootstrap-transition.js.
Yenza okuqukethwe kwakho kusebenze njengemodeli. Yamukela izinketho ozikhethela object
.
- $ ( '#myModal' ). imodeli ({
- ikhibhodi : amanga
- })
Iguqula ngokwenza i-modal.
- $ ( '#myModal' ). i-modal ( 'guqula' )
Ivula mathupha i-modal.
- $ ( '#myModal' ). imodeli ( 'show' )
Ifihla i-modal ngokwenza.
- $ ( '#myModal' ). i-modal ( 'fihla' )
Ikilasi le-modal ye-Bootstrap lidalula imicimbi embalwa ukuze ixhume ekusebenzeni kwe-modal.
Umcimbi | Incazelo |
---|---|
umbukiso | Lo mcimbi uvutha ngokushesha lapho show indlela yesibonelo ibizwa. |
kubonisiwe | Lo mcimbi uxoshwa lapho i-modal yenziwe yabonakala kumsebenzisi (izolinda ukuthi izinguquko ze-css ziqedele). |
fihla | Lo mcimbi uxoshwa ngokushesha lapho hide indlela yesibonelo ibizwa. |
kufihliwe | Lo mcimbi uxoshwa lapho i-modal isiqedile ukufihlwa kumsebenzisi (izolinda ukuthi izinguquko ze-css ziqedele). |
- $ ( '#myModal' ). ku ( 'kufihliwe' , umsebenzi () {
- // enza into…
- })
Engeza amamenyu okwehlayo cishe kunoma yini ku-Bootstrap ngale plugin elula. I-Bootstrap inokusekelwa okugcwele kwemenyu eyehlayo ku-navbar, amathebhu, namaphilisi.
Landa ifayelaChofoza izixhumanisi ze-nav eyehlayo ku-navbar namaphilisi angezansi ukuze uhlole okwehliswayo.
Shayela okwehliswayo nge-javascript:
- $ ( '.ukuguqula-okwehlayo' ). okwehlayo ()
Ukwengeza ngokushesha ukusebenza kokwehla kunoma iyiphi into vele ungeze data-toggle="dropdown"
futhi noma yikuphi okwehliswayo kwe-bootstrap okuvumelekile kuzovulwa ngokuzenzakalelayo.
data-target="#fat"
noma
href="#fat"
.
- <ul class = "nav nav-pills" >
- <li class = "active" ><a href = "#" > Isixhumanisi esijwayelekile </a></li>
- <li class = "dropdown" id = "menu1" >
- <a class = "dropdown-toggle" data-toggle = "dropdown" href = "#menu1" >
- Okwehlayo
- <b class = "caret" ></b>
- </a>
- <ul class = "imenyu eyehlayo" >
- <li><a href = "#" > Isenzo </a></li>
- <li><a href = "#" > Esinye isenzo </a></li>
- <li><a href = "#" > Okunye okunye lapha </a></li>
- <li class = "divider" ></li>
- <li><a href = "#" > Isixhumanisi esihlukanisiwe </a></li>
- </ul>
- </li>
- ...
- </ul>
Ukuze ugcine ama-URL eqinile, sebenzisa data-target
isibaluli esikhundleni se- href="#"
.
- <ul class = "nav nav-pills" >
- <li class = "okwehlayo" >
- <a class = "dropdown-toggle" data-toggle = "dropdown" data-target = "#" href = "path/to/page.html" >
- Okwehlayo
- <b class = "caret" ></b>
- </a>
- <ul class = "imenyu eyehlayo" >
- ...
- </ul>
- </li>
- </ul>
I-api ehlelekile yokwenza amamenyu asebenze ku-navbar enikeziwe noma ukuzulazula okunethebhu.
I-plugin ye-ScrollSpy ingeyokuvuselela ngokuzenzakalelayo okuhlosiwe kwe-nav ngokusekelwe endaweni yokuskrola.
Landa ifayelaSkrola indawo engezansi bese ubuka isibuyekezo sokuzulazula. Izinto ezincanyana zokwehla zizogqanyiswa nazo. Izame!
I-Ad leggings keytar, i-brunch id art party dolor labore. I-Pitchfork ineminyaka engu-nim lo-fi ngaphambi kokuthi bathengise yonke into. Amalungelo ebhayisikili e-Tumblr epulazini ukuya etafuleni noma yini. I-Cardigan ene-anim keffiyeh carles. Indlwana yezithombe ka-Velit seitan mcsweeney 3 wolf moon irure. Ijezi le-Cosby lomo jean shorts, i-williamsburg hoodie minim qui cishe awukaze uzwe ngazo et cardigan trust fund culpa biodiesel wes anderson aesthetic. U-Nihil one-tattooed accusamus, cred irony biodiesel keffiyeh artisan ullamco consequat.
Veniam marfa amadevu skateboard, adipisicing fugiat velit pitchfork intshebe. Freegan intshebe aliqua cupidatat mcsweeney's vero. Cupidatat ezine loko nisi, ea helvetica nulla carles. Iloli lokudla lejezi le-cosby eline-tattoo, i-mcsweeney's quis non freegan vinyl. I-Lo-fi wes anderson +1 sartorial. I-Carles non-aesthetic exercitation i-quis gentrify. I-Brooklyn adipisicing craft beer vice keytar deserunt.
I-Occaecat commodo aliqua deelectus. I-Fap craft beer deserunt skateboard ea. Amalungelo ebhayisikili e-Lomo adipisicing banh mi, velit ea sunt next level locavore ikhofi yemvelaphi eyodwa e-magna veniam. I-vinyl id yempilo ephezulu, i-echo park consequat quis aliquip banh mi pitchfork. Vero VHS est adipisicing. Consectetur nisi DIY minim messenger bag. I-Cred ex in, i-iphone eqhubekayo deelectus consectetur fanny pack.
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 messenger bag marfa whatever deelectus food truck. Sapiente synth id imaginenda. I-Locavore sed helvetica cliche irony, ama-thundercats cishe awukaze uzwe ngawo consequat hoodie gluten-free lo-fi fap aliquip. I-Labore elit placeat ngaphambi kokuba ithengiswe, u-terry richardson proident brunch nesciunt quis cosby sweater pariatur keffiyeh ut helvetica artisan. I-Cardigan craft beer seitan readymade velit. I-VHS chambray laboris tempor veniam. Anim mollit minim commodo ullamco thundercats.
Shayela i-scrollspy nge-javascript:
- $ ( '#navbar' ). scrollspy ()
Ukwengeza kalula impatho ye-scrollspy ekuzulazuleni kwe data-spy="scroll"
-topbar yakho, vele wengeze entweni ofuna ukuyihlola (imvamisa lokhu kuzoba umzimba).
- <body data-spy = "scroll" > ... </body>
<a href="#home">home</a>
must ihambisane nento ethile edomini efana
<div id="home"></div>
.
Uma usebenzisa i-scrollspy ngokuhambisana nokwengeza noma ukususa izakhi ku-DOM, uzodinga ukushayela indlela yokuvuselela kanje:
- $ ( '[data-spy="scroll"]' ). ngakunye ( umsebenzi () {
- var $spy = $ ( lokhu ). scrollspy ( 'refresh' )
- });
Igama | uhlobo | okuzenzakalelayo | incazelo |
---|---|---|---|
offset | inombolo | 10 | Amaphikseli okufanele uwasuse ukusuka phezulu uma ubala indawo yokuskrola. |
Umcimbi | Incazelo |
---|---|
vula | Lo mcimbi uvutha noma nini lapho into entsha yenziwa isebenze i-scrollspy. |
Le plugin yengeza ithebhu esheshayo, eguqukayo kanye nokusebenza kwamaphilisi ukuze kudlule okuqukethwe kwasendaweni.
Landa ifayelaChofoza amathebhu angezansi ukuze uguqule phakathi kwamafasitelana afihliwe, ngisho nangamamenyu okwehlayo.
I-denim eluhlaza cishe awuzange uzwe ngabo izikhindi ze-jean Austin. I-Nesciunt tofu stumptown aliqua, i-retro synth master cleanse. Amadevu cliche tempor, williamsburg carles vegan helvetica. Reprehenderit butcher retro keffiyeh dreamcatcher synth. Ijezi le-Cosby eu banh mi, qui irure terry richardson ex squid. Aliquip placeat salvia cillum iphone. Seitan aliquip quis cardigan american apparel, butcher voluptate nisi 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 ngaphambi kokuba badayise i-master cleanse gluten-free squid scenester freegan cosby sweater. I-Fanny pack portland seitan DIY, i-art party locavore wolf cliche high life echo park Austin. I-Cred vinyl keffiyeh DIY salvia PBR, banh mi ngaphambi kokuthi bathengise i-VHS viral locavore cosby sweater. I-Lomo wolf viral, amadevu alungile enziwe ama-thundercats keffiyeh craft beer marfa ethical. Wolf salvia freegan, sartorial keffiyeh echo park vegan.
Nika amandla amathebhu aphathekayo nge-javascript (ithebhu ngayinye idinga ukwenziwa isebenze ngayodwana):
- $ ( '#myTab a' ). chofoza ( umsebenzi ( e ) {
- e . vimbelaOkuzenzakalelayo ();
- $ ( lokhu ). ithebhu ( 'show' );
- })
Ungavula amathebhu ngamanye ngezindlela ezimbalwa:
- $ ( '#myTab a[href="#profile"]' ). ithebhu ( 'show' ); // Khetha ithebhu ngegama
- $ ( '#myTab a:first' ). ithebhu ( 'show' ); // Khetha ithebhu yokuqala
- $ ( '#myTab a:last' ). ithebhu ( 'show' ); // Khetha ithebhu yokugcina
- $ ( '#myTab li:eq(2) a' ). ithebhu ( 'show' ); // Khetha ithebhu yesithathu (0-inkomba)
Ungakwazi ukuvula ithebhu noma ukuzulazula kwephilisi ngaphandle kokubhala noma iyiphi i-javascript ngokucacisa data-toggle="tab"
noma ngento data-toggle="pill"
ethile. Ukwengeza i- nav
kanye nav-tabs
namakilasi kuthebhu ul
kuzosebenzisa isitayela sethebhu ye-bootstrap.
- <ul class = "nav-tabs" >
- <li><a href = "#home" data-toggle = "tab"> Ikhaya </a></li >
- <li><a href = "#profile" data-toggle = "tab"> Iphrofayili </a></li >
- <li><a href = "#messages" data-toggle = "tab"> Imilayezo </a></li >
- <li><a href = "#settings" data-toggle = "tab"> Izilungiselelo </a></li >
- </ul>
Yenza i-elementi yethebhu isebenze nesiqukathi sokuqukethwe. Ithebhu kufanele ibe no-a data-target
noma i href
-container node ku-DOM.
- <ul class = "nav nav-tabs" id = "myTab" >
- <li class = "active" ><a href = "#home"> Ikhaya </a></li >
- <li > <a href = "#iphrofayili"> Iphrofayili </a></li>
- <li><a href = "#imiyalezo" > Imilayezo </a></li>
- <li > <a href = "#settings"> Izilungiselelo </a></li>
- </ul>
- <div class = "ithebhu-okuqukethwe" >
- <div class = "i-tab-pane esebenzayo" id = "ikhaya" > ... </div>
- <div class = "tab-pane" id = "profile" > ... </div>
- <div class = "tab-pane" id = "imiyalezo" > ... </div>
- <div class = "tab-pane" id = "izilungiselelo" > ... </div>
- </div>
- <script>
- $ ( umsebenzi () {
- $ ( '#myTab a:last' ). ithebhu ( 'show' );
- })
- </script>
Umcimbi | Incazelo |
---|---|
umbukiso | Lo mcimbi uvutha embukisweni wethebhu, kodwa ngaphambi kokuthi kuboniswe ithebhu entsha. Sebenzisa event.target futhi event.relatedTarget uqondise ithebhu esebenzayo kanye nethebhu esebenzayo yangaphambilini (uma ikhona) ngokulandelanayo. |
kubonisiwe | Lo mcimbi uvutha embukisweni wethebhu ngemva kokuthi ithebhu isibonisiwe. Sebenzisa event.target futhi event.relatedTarget uqondise ithebhu esebenzayo kanye nethebhu esebenzayo yangaphambilini (uma ikhona) ngokulandelanayo. |
- $ ( 'a[data-toggle="tab"]' ). ku ( 'kubonisiwe' , umsebenzi ( e ) {
- e . target // ithebhu evuliwe
- e . relatedTarget // ithebhu yangaphambilini
- })
Igqugquzelwe i-plugin enhle kakhulu ye-jQuery.tipsy ebhalwe ngu-Jason Frame; Amathuluzi ayinguqulo ebuyekeziwe, engancikile ezithombeni, sebenzisa i-css3 ukuze uthole ukugqwayiza, kanye nezibaluli zedatha zokulondoloza isihloko sendawo.
Landa ifayelaHambisa phezulu kwezixhumanisi ezingezansi ukuze ubone amathuluzi:
Amabhulukwe aqinile ezingeni elilandelayo keffiyeh cishe awuzwanga ngawo. Photo booth intshebe eluhlaza yedenim letterpress vegan messenger bag stumptown. Isambatho se-farm-to-table seitan, i-mcsweeney's fixie sustainable quinoa 8-bit american apparel ine- terry richardson vinyl chambray. Izintshebe stumptown, cardigans banh mi lomo thundercats. I-Tofu biodiesel williamsburg marfa, four loko mcsweeney's cleanse vegan chambray. Ingcweti ehlekisayo ngempela whatever keytar , i-movie-to-table banksy Austin twitter handle freegan cred raw denim single-origin coffee viral.
Qalisa ithiphu yamathuluzi nge-javascript:
- $ ( '#isibonelo' ). ithiphu ( izinketho )
Igama | uhlobo | okuzenzakalelayo | incazelo |
---|---|---|---|
izithombe | boolean | iqiniso | sebenzisa inguquko ye-css fade ethiphu yamathuluzi |
ukubekwa | umucu|umsebenzi | 'phezulu' | indlela yokubeka ithiphu yamathuluzi - phezulu | phansi | kwesokunxele | kwesokudla |
isikhethi | umucu | amanga | Uma kunikezwa isikhethi, izinto zethiphu yamathuluzi zizodluliselwa kulokho okuhlosiwe okucacisiwe. |
isihloko | umucu | umsebenzi | '' | inani lesihloko elizenzakalelayo uma umaka `wesihloko` ungekho |
inhlamvu | umucu | 'hambahamba' | ukuthi ithiphu yamathuluzi icushwa kanjani - hambisa phezulu | gxila | imanuwali |
ukubambezela | inombolo | into | 0 | ukubambezeleka ukubonisa nokufihla ithiphu yamathuluzi (ms) - ayisebenzi ohlotsheni lwesicuphi sesandla Uma inombolo inikezwa, ukubambezeleka kusetshenziswa kukho kokubili ukufihla/umbukiso Isakhiwo sento sithi: |
Ngenxa yezizathu zokusebenza, Ithulithiphu kanye ne-Popover data-apis zingena. Uma ungathanda ukuzisebenzisa vele ucacise inketho yesikhethi.
- <a href = "#" rel = "tooltip" title = "ithulusi lokuqala"> hambisa phezu kwami </a>
Inamathisela isibambi sethulithiphu eqoqweni lesici.
Iveza ithulithiphu yento ethile.
- $ ( '#element' ). ithiphu yamathuluzi ( 'show' )
Ifihla ithiphu yento ethile.
- $ ( '#element' ). ithiphu yamathuluzi ( 'fihla' )
Iguqula ithiphu lethuluzi le-elementi.
- $ ( '#element' ). ithiphu yamathuluzi ( 'guqula' )
Engeza izimbondela ezincane zokuqukethwe, njengalezo eziku-iPad, kunoma iyiphi into ukuze uthole ulwazi lwesibili lwezindlu.
* Idinga ithiphu yamathuluzi ukuthi ifakwe
Landa ifayelaHambisa phezulu kwenkinobho ukuze uqalise i-popover.
Nika amandla ama-popovers nge-javascript:
- $ ( '#isibonelo' ). i- popover ( izinketho )
Igama | uhlobo | okuzenzakalelayo | incazelo |
---|---|---|---|
izithombe | boolean | iqiniso | sebenzisa inguquko ye-css fade ethiphu yamathuluzi |
ukubekwa | umucu|umsebenzi | 'kwesokudla' | indlela yokubeka i-popover - phezulu | phansi | kwesokunxele | kwesokudla |
isikhethi | umucu | amanga | uma kunikezwa isikhethi, izinto zethulithiphu zizodluliselwa kulokho okuhlosiwe |
inhlamvu | umucu | 'hambahamba' | ukuthi ithiphu yamathuluzi icushwa kanjani - hambisa phezulu | gxila | imanuwali |
isihloko | umucu | umsebenzi | '' | inani lesihloko elizenzakalelayo uma isibaluli `sesihloko` singekho |
okuqukethwe | umucu | umsebenzi | '' | inani lokuqukethwe elizenzakalelayo uma isibaluli `sokuqukethwe kwedatha` singekho |
ukubambezela | inombolo | into | 0 | ukubambezeleka ukubonisa nokufihla i-popover (ms) - ayisebenzi ohlotsheni lwe-trigger okwenziwa ngesandla Uma inombolo inikezwa, ukubambezeleka kusetshenziswa kukho kokubili ukufihla/umbukiso Isakhiwo sento sithi: |
Ngenxa yezizathu zokusebenza, Ithulithiphu kanye ne-Popover data-apis zingena. Uma ungathanda ukuzisebenzisa vele ucacise inketho yesikhethi.
Iqalisa ama-popover eqoqo le-elementi.
Iveza i-popover yama-elementi.
- $ ( '#element' ). i- popover ( 'show' )
Ifihla i-popover yama-elementi.
- $ ( '#element' ). i- popover ( 'fihla' )
Iguqula i-popover yezinto.
- $ ( '#element' ). i- popover ( 'guqula' )
I-plugin yesixwayiso iyikilasi elincane lokwengeza ukusebenza okuseduze kuzaziso.
LandaI-plugin yezaziso isebenza emilayezweni eyisixwayiso evamile, futhi ivimbe imilayezo.
Shintsha lokhu nalokhu bese uzama futhi. Duis mollis, est non commodo luctus, nisi erat porttitor ligula, eget lacinia odio sem nec elit. I-Cras mattis consectetur purus sit amet fermentum.
Nika amandla ukuchithwa kwesexwayiso nge-javascript:
- $ ( ".isaziso" ). qaphela ()
Vele ungeze data-dismiss="alert"
enkinobheni yakho yokuvala ukuze unikeze ngokuzenzakalelayo ukusebenza kwesexwayiso sokuvala.
- <a class = "close" data-dismiss = "alert" href = "#" > × </a>
Igoqa zonke izexwayiso ngokusebenza okuseduze. Ukuze izexwayiso zakho zigqwayize uma zivaliwe, qiniseka ukuthi sezisetshenzisiwe .fade
futhi .in
nekilasi kuzo.
Ivala isexwayiso.
- $ ( ".isaziso" ). isixwayiso ( 'vala' )
Ikilasi lesexwayiso le-Bootstrap lidalula imicimbi embalwa ukuze ixhumeke ekusebenzeni kwesixwayiso.
Umcimbi | Incazelo |
---|---|
vala | Lo mcimbi uvutha ngokushesha lapho close indlela yesibonelo ibizwa. |
ivaliwe | Lo mcimbi uyaxoshwa uma isaziso sivaliwe (sizolinda ukuthi izinguquko ze-css ziqedele). |
- $ ( '#isaziso sami' ). bopha ( 'kuvaliwe' , umsebenzi () {
- // enza into…
- })
Thola izitayela eziyisisekelo nosekelo oluguquguqukayo lwezingxenye ezigoqekayo njengama-accordion nokuzulazula.
Landa ifayela* Idinga i-plugin ye-Transitions ukuthi ifakwe.
Sisebenzisa i-plugin yokugoqa, sakhe iwijethi yesitayela se-accordion elula:
Nika amandla nge-javascript:
- $ ( ".goqa" ). bhidliza ()
Igama | uhlobo | okuzenzakalelayo | incazelo |
---|---|---|---|
umzali | isikhethi | amanga | Uma isikhethi khona-ke zonke izici ezigoqekayo ngaphansi komzali othile zizovalwa lapho le nto egoqekayo iboniswa. (okufana nokuziphatha kwe-accordion yendabuko) |
guqula | boolean | iqiniso | Iguqula into egoqekayo ekunxuseni |
Vele ungeze data-toggle="collapse"
futhi u-a data-target
ku-elementi ukuze unikeze ngokuzenzakalelayo ukulawula kwento egoqekayo. Isibaluli data-target
samukela isikhethi se-css ongafaka kuso ukugoqa. Qiniseka ukuthi ungeza ikilasi collapse
ku-elementi egoqekayo. Uma ungathanda ukuthi ivuleke ngokuzenzakalelayo, engeza iklasi elengeziwe in
.
- <button class = "btn btn-danger" data-toggle = "collapse" data-target = "#demo" >
- elula egoqekayo
- </inkinobho>
- <div id = "demo" class = "goqa phakathi" > … </div>
data-parent="#selector"
. Bheka idemo ukuze ubone lokhu kusebenza.
Yenza okuqukethwe kwakho kusebenze njengento egoqekayo. Yamukela izinketho ozikhethela object
.
- $ ( '#myCollapsible' ). bhidlika ({
- guqula : amanga
- })
Iguqula into egoqekayo ukuze iboniswe noma ifihlwe.
Ibonisa into egoqekayo.
Ifihla into egoqekayo.
Ikilasi lokugoqa le-Bootstrap lidalula imicimbi embalwa ukuze ixhumeke ekusebenzeni kokugoqa.
Umcimbi | Incazelo |
---|---|
umbukiso | Lo mcimbi uvutha ngokushesha lapho show indlela yesibonelo ibizwa. |
kubonisiwe | Lo mcimbi uxoshwa lapho isici sokugoqa senziwe sabonakala kumsebenzisi (sizolinda ukuthi izinguquko ze-css ziqedele). |
fihla | Lo mcimbi uxoshwa ngokushesha lapho hide indlela isibiziwe. |
kufihliwe | Lo mcimbi uxoshwa lapho isici sokugoqa sifihliwe kumsebenzisi (sizolinda ukuthi izinguquko ze-css ziqedele). |
- $ ( '#myCollapsible' ). ku ( 'kufihliwe' , umsebenzi () {
- // enza into…
- })
I-plugin evamile yokuhamba ngebhayisikili ngokusebenzisa izici. I-merry-go-round.
Landa ifayelaBuka umbukiso wesilayidi ngezansi.
Shaya nge-javascript:
- $ ( '.carousel' ). i- carousel ()
Igama | uhlobo | okuzenzakalelayo | incazelo |
---|---|---|---|
isikhawu | inombolo | 5000 | Inani lesikhathi sokubambezeleka phakathi kokuhamba ngebhayisikili ngokuzenzakalela into. Uma kungamanga, i-carousel ngeke ijikeleze ngokuzenzakalelayo. |
ima kancane | umucu | "hambahamba" | Imisa ibhayisikili le-carousel ku-mouseenter futhi iqalise kabusha ukujikeleza kwe-carousel ku-mouseleave. |
Izibaluli zedatha zisetshenziselwa ukulawulwa kwangaphambilini nokulandelayo. Bheka umaka oyisibonelo ngezansi.
- <div id = "myCarousel" class = "carousel slide" >
- <!-- Izinto ze-carousel -->
- <div class = "i-carousel-inner" >
- <div class = "into esebenzayo" > … </div>
- <div class = "into" > … </div>
- <div class = "into" > … </div>
- </div>
- <!-- I-Carousel nav -->
- <a class = "carousel-control left" href = "#myCarousel" data-slide = "prev" > ‹ </a>
- <a class = "carousel-control right" href = "#myCarousel" data-slide = "next" > › </a>
- </div>
Iqalisa i-carousel ngezinketho zokuzithandela object
futhi iqala ukuhamba ngebhayisikili ezintweni.
- $ ( '.carousel' ). i- carousel ({
- Isikhathi : 2000
- })
Izungeza izinto ze-carousel ukusuka kwesokunxele kuye kwesokudla.
Imisa i-carousel ekuhambeni ngebhayisikili ezintweni.
Ibiyela i-carousel kuhlaka oluthile (okusekelwe ngo-0, okufana namalungu afanayo).
Imijikelezo eya entweni edlule.
Imijikelezo eya entweni elandelayo.
Ikilasi le-carousel le-Bootstrap lidalula imicimbi emibili yokuxhunywa ekusebenzeni kwe-carousel.
Umcimbi | Incazelo |
---|---|
shelela | Lo mcimbi uvutha ngokushesha lapho slide indlela yesibonelo isetshenziswa. |
shibilika | Lo mcimbi uxoshwa lapho i-carousel isiqedile ukuguqulwa kwama-slide. |
I-plugin eyisisekelo, enwetshwe kalula yokudala ngokushesha ama-typehead amahle nganoma iyiphi indlela yokufaka umbhalo.
Landa ifayelaQala ukuthayipha kunkambu engezansi ukuze ubonise imiphumela ye-typeahead.
Shayela i-typeahead nge-javascript:
- $ ( '.typeahead' ). i-typehead ()
Igama | uhlobo | okuzenzakalelayo | incazelo |
---|---|---|---|
umthombo | uhlu | [ ] | Umthombo wedatha ongabuza ngawo. |
izinto | inombolo | 8 | Inombolo enkulu yezinto ezoboniswa kokwehliswayo. |
umenzi | umsebenzi | icala alizwani | Indlela esetshenziselwa ukunquma ukuthi umbuzo ufana nento ethile. Yamukela i-agumenti eyodwa, item okuzovivinywa ngayo umbuzo. Finyelela embuzweni wamanje nge- this.query . Buyisa i-boolean true uma umbuzo ufana. |
umhleli | umsebenzi | ukufana ncamashi, ukuzwela kwecala, akuzwakali |
Indlela esetshenzisiwe ukuhlunga imiphumela yokuqedela ngokuzenzakalela. Yamukela impikiswano eyodwa items futhi inobubanzi besibonelo se-typeahead. Bhekisela umbuzo wamanje ngokuthi this.query . |
i-highlighter | umsebenzi | igqamisa konke okufanayo okuzenzakalelayo | Indlela esetshenzisiwe ukugqamisa imiphumela yokuqedela ngokuzenzakalela. Yamukela impikiswano eyodwa item futhi inobubanzi besibonelo se-typeahead. Kufanele ibuyise i-html. |
Engeza izibaluli zedatha ukuze ubhalise i-elementi ngokusebenza kwe-typeahead.
- <input type = "text" data-provide = "typeahead" >
Iqalisa okokufaka nge-typeahead.