Zisa izinto ze-Bootstrap ebomini-ngoku kunye neeplagi ze- jQuery zesiko ezili-12 .
I-plugin elungelelanisiweyo, kodwa eguquguqukayo, ithatha i-plugin ye-javascript ye-modal yendabuko enobuncinane obufunekayo obufunekayo kunye nokusilela okuhlakaniphile.
Yongeza iimenyu ezihlayo phantse kuyo yonke into eBootstrap ngale plugin ilula. I-Bootstrap inenkxaso epheleleyo yemenyu eyehlayo kwi-navbar, iithebhu, kunye neepilisi.
Sebenzisa i-scrollspy ukuhlaziya ngokuzenzekelayo amakhonkco kwi-navbar yakho ukubonisa ikhonkco elisebenzayo langoku elisekwe kwindawo yokuskrola.
Sebenzisa le plugin ukwenza iithebhu kunye neepilisi zibe luncedo ngakumbi ngokuzivumela ukuba ziguqule kwiipaneli ze-tabhable zomxholo wendawo.
Ukuthatha okutsha kwiplagi ye-jQuery Tipsy, Iingcebiso zezixhobo azithembeli kwimifanekiso-zisebenzisa i-CSS3 yoopopayi kunye neempawu zedatha zogcino lwesihloko sendawo.
Yongeza imixholo emincinci, njengaleyo ikwi-iPad, kuyo nayiphi na into yolwazi lwesibini lwezindlu.
* Ifuna iingcebiso zesixhobo ukuba zibandakanywe
Iplagi yesilumkiso yiklasi encinci yokongeza ukusebenza ngokusondeleyo kwizilumkiso.
Yenza ngakumbi ngamaqhosha. Iqhosha lokulawula lixela okanye wenze amaqela amaqhosha amalungu amaninzi njengebar yesixhobo.
Fumana izitayile ezisisiseko kunye nenkxaso ebhetyebhetye kumacandelo aqengqelekayo anje ngeaccordion kunye nokuhamba.
Yenza umjikelo wolonwabo lwawo nawuphi na umxholo onqwenela ukubonelela ngomboniso wesilayidi esisebenzisanayo somxholo.
I-plugin esisiseko, eyandisiweyo ngokulula yokwenza ngokukhawuleza iintloko zokuchwetheza ezintle ngalo naluphi na uhlobo lokufakwa kombhalo.
Ngeziphumo ezilula zotshintsho, quka i-bootstrap-transition.js kube kanye ukutyibilika kwiimodyuli okanye ukucima izilumkiso.
* Iyimfuneko kuopopayi kwiiplagi
I-plugin elungelelanisiweyo, kodwa eguquguqukayo, ithatha i-plugin ye-javascript ye-modal yendabuko enobuncinane obufunekayo obufunekayo kunye nokusilela okuhlakaniphile.
Khuphela ifayileApha ngezantsi kukho imodali enikezelwe ngokwezibalo.
Umzimba omnye olungileyo…
Guqula imodal ngejavascript ngokucofa iqhosha elingezantsi. Iza kutyibilika phantsi kwaye iphele ukusuka phezulu ephepheni.
Qalisa imodal yedemoFowunela imodal usebenzisa ijavascript:
- $ ( '#myModal' ). imodeli ( iinketho )
Igama | uhlobo | ukungagqibeki | inkcazelo |
---|---|---|---|
ngasemva | boolean | yinyani | Ibandakanya i-modal-backdrop element. Kungenjalo, khankanya static imeko yangasemva engayivaliyo imodal ngokucofa. |
ikhibhodi | boolean | yinyani | Ivala imodal xa iqhosha lokubaleka licofa |
bonisa | boolean | yinyani | Ibonisa imodali xa iqaliswa. |
Unokwenza iimodyuli kwiphepha lakho ngokulula ngaphandle kokubhala umgca omnye wejavascript. Ukuseta data-toggle="modal"
nje into yokulawula ene data-target="#foo"
okanye href="#foo"
ehambelana ne-id yesiqalelo se-modal, kwaye xa ucofa, iyakusungula imodal yakho.
Kwakhona, ukongeza iinketho kumzekelo wakho wemodal, zibandakanye nje njengeempawu ezongezelelweyo zedatha nokuba yinto yolawulo okanye imodal markup ngokwayo.
- <a iklasi = "btn" data-toggle = "modal" href = "#myModal" > Yazisa iNdlela </a>
- <div class = "modal hide" id = "myModal" >
- <div class = "modal-header" >
- < uhlobo lweqhosha = "iqhosha" iklasi = "vala" idatha-dismiss = "modal" > × </ iqhosha>
- <h3> imodal header </h3>
- </ div>
- <div class = "modal-body" >
- <p> Umzimba omnye olungileyo… </p>
- </ div>
- <div class = "modal-footer" >
- <a href = "#" class = "btn" data-dismiss = "modal"> Vala </a> _
- <a href = "#" class = "btn btn-primary"> Gcina utshintsho </a>
- </ div>
- </ div>
.fade
iklasi
.modal
kwinto (jonga kwidemo ukuze ubone oku kusebenza) kwaye uquke i-bootstrap-transition.js.
Yenza umxholo wakho ube yimodali. Yamkela iinketho ozikhethelayo object
.
- $ ( '#myModal' ). imodeli ({
- keyboard : bubuxoki
- })
Yenza imodal ngesandla.
- $ ( '#myModal' ). imodali ( 'tshintsha' )
Ivula imodali ngesandla.
- $ ( '#myModal' ). imodali ( 'bonisa' )
Ufihla imodali ngesandla.
- $ ( '#myModal' ). imodali ( 'fihla' )
Iklasi ye-modal ye-Bootstrap iveza iminyhadala embalwa yokuqhagamshelwa ekusebenzeni kwe-modal.
Isiganeko | Inkcazo |
---|---|
bonisa | Esi siganeko sivutha ngokukhawuleza xa show kubizwa indlela yomzekelo. |
ibonisiwe | Esi siganeko sigxothwa xa i-modal yenziwe yabonakala kumsebenzisi (iya kulinda iinguqu ze-css ukuba zigqibe). |
fihla | Esi siganeko sigxothwa ngokukhawuleza xa hide indlela yomzekelo ibiziwe. |
efihliweyo | Esi siganeko siyagxothwa xa i-modal igqibile ukufihlwa kumsebenzisi (iya kulinda i-css transitions ukuba igqibe). |
- $ ( '#myModal' ). kwi ( 'ifihliwe' , umsebenzi () {
- // Yenza into…
- })
Yongeza iimenyu ezihlayo phantse kuyo yonke into eBootstrap ngale plugin ilula. I-Bootstrap inenkxaso epheleleyo yemenyu eyehlayo kwi-navbar, iithebhu, kunye neepilisi.
Khuphela ifayileCofa kwi-dropdown nav links kwi-navbar kunye neepilisi ezingezantsi ukuvavanya ukuhla.
Fowunela ukwehla ngejavascript:
- $ ( '.ukuhla-ukuguqula' ). ukwehla ()
Ukongeza ngokukhawuleza ukusebenza kokwehla kuyo nayiphi na into yongeza nje data-toggle="dropdown"
kwaye nakuphi na ukuhla kwe-bootstrap okusebenzayo kuya kwenziwa kusebenze ngokuzenzekelayo.
data-target="#fat"
okanye
href="#fat"
.
- <ul class = "nav nav-pills" >
- <li iklasi = "esebenzayo" > <a href = "#"> Ikhonkco eliqhelekileyo </a></li>
- <li class = "dropdown" id = "menu1" >
- <a class = "dropdown-toggle" data-toggle = "dropdown" href = "#menu1"> _
- Lahla phantsi
- <b iklasi = "inkathalo" ></b>
- </a>
- <ul class = "dropdown-menu" >
- <li><a href = "#"> Isenzo </a> </li>
- <li><a href = "#" > Esinye isenzo </a></li>
- <li><a href = "#" > Enye into apha </a></li>
- <li iklasi = "isahluli" > </ li>
- <li><a href = "#"> Ikhonkco elahluliweyo </a></li>
- </ul>
- </ li>
- ...
- </ul>
Ukugcina ii-URL zicocekile, sebenzisa data-target
uphawu loyelelwano endaweni ye href="#"
.
- <ul class = "nav nav-pills" >
- <li iklasi = "ehlayo" >
- <a class = "dropdown-toggle" data-toggle = "dropdown" data-target = "#" href = "path/to/page.html" >
- Lahla phantsi
- <b iklasi = "inkathalo" ></b>
- </a>
- <ul class = "dropdown-menu" >
- ...
- </ul>
- </ li>
- </ul>
I-api ecwangcisiweyo yokuvula iimenu zebar ye navbar enikiweyo okanye ukukhangela kwe tab.
I-plugin yeScrollSpy yeyokuhlaziya ngokuzenzekelayo iithagethi ze-nav ngokusekelwe kwindawo yokuskrola.
Khuphela ifayileSkrolela indawo engezantsi kwaye ubukele uhlaziyo lokukhangela. Imiba esezantsi yokwehla nayo iya kuphawulwa. Yizame!
Ad leggings keytar, brunch id art party dolor labore. I-Pitchfork ngonyaka enim lo-fi ngaphambi kokuba bathengise yonke into. Tumblr ifama-to-itheyibhile amalungelo ibhayisekile nantoni na. Anim keffiyeh carles cardigan. Velit seitan mcsweeney's photo booth 3 wolf moon irure. Ijezi kaCosby ilomo yejean ezimfutshane, williamsburg hoodie minim qui mhlawumbi awuzange uve ngazo et cardigan trust fund culpa biodiesel wes anderson aesthetic. UNihil une tattoo accsamus, cred irony biodiesel keffiyeh artisan ullamco consequat.
Veniam marfa amadevu ngesityibiliki, adipisicing fugiat velit pitchfork iindevu. Freegan iindevu aliqua cupidatat mcsweeney's vero. Cupidatat ezine loko nisi, ea helvetica nulla carles. I-Tattooed cosby sweater ilori yokutya, i-mcsweeney's quis non freegan vinyl. Lo-fi wes anderson +1 sartorial. Carles non aesthetic exercitation quis gentrify. EBrooklyn adipisicing craft beer vice keytar deserunt.
Occaecat commodo aliqua deelectus. Fap craft beer deserunt skateboard ea. Amalungelo ebhayisekile eLomo adipisicing banh mi, velit ea sunt kwinqanaba elilandelayo locavore ikofu enemvelaphi eyodwa e magna veniam. Ubomi obuphezulu id vinyl, echo park consequat quis aliquip banh mi pitchfork. Vero VHS est adipisicing. Consectetur nisi DIY minim messenger bag. Cred ex in, ezinzileyo deelectus 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 isithunywa bag marfa nantoni na ilori yokutya deelectus. Sapiente synth id guessnda. Locavore sed helvetica cliche irony, thundercats mhlawumbi awuzange uve ngazo consequat hoodie gluten-free lo-fi fap aliquip. Labore elit placeat phambi kokuba bathengise, terry richardson proident brunch nesciunt quis cosby sweater pariatur keffiyeh ut helvetica artisan. Cardigan craft beer seitan readymade velit. VHS chambray laboris tempor veniam. Anim mollit minim commodo ullamco thundercats.
Fowunela iscrollspy ngejavascript:
- $ ( '#navbar' ). skrola ()
Ukongeza ngokulula isimilo sokuskrola kulawulo lwakho lwebar ephezulu, yongeza data-spy="scroll"
nje kwinto ofuna ukuyihlola (ubukhulu becala lo iyakuba ngumzimba).
- <body data-spy = "skrola" > ... </ body>
<a href="#home">home</a>
kufuneka ihambelane nento ekwidom efana
<div id="home"></div>
.
Xa usebenzisa i-scrollspy ngokudibanisa okanye ukususa izinto kwi-DOM, kuya kufuneka ufowunele indlela yokuhlaziya ngolu hlobo:
- $ ( '[data-spy="scroll"]' ). Nganye ( umsebenzi () {
- var $ hlola = $ ( le ). scrollspy ( 'hlaziya' )
- });
Igama | uhlobo | ukungagqibeki | inkcazelo |
---|---|---|---|
i-offset | inani | 10 | Iipikseli zokulinganisa ukusuka phezulu xa ubala indawo yokuskrola. |
Isiganeko | Inkcazo |
---|---|
vula | Esi siganeko sivutha nanini na into entsha ivuliwe yi-scrollspy. |
Le plugin yongeza ithebhu ekhawulezayo, eguquguqukayo kunye nokusebenza kweepilisi zokutshintshwa ngomxholo wendawo.
Khuphela ifayileCofa iithebhu ezingezantsi ukuguqula phakathi kweefestile ezifihliweyo, nokuba usebenzisa imenu eyehlayo.
Idenim ekrwada mhlawumbi awuzange uve ngabo ibhulukhwe yejean yaseAustin. Nesciunt tofu stumptown aliqua, retro synth master coca. Amadevu cliche tempor, williamsburg carles vegan helvetica. Reprehenderit butcher retro keffiyeh dreamcatcher synth. Ijezi yeCosby eu banh mi, qui irure terry richardson ex squid. Aliquip placeat salvia cillum iphone. Seitan aliquip quis cardigan american iimpahla, 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 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.
Yenza iithebhu ezinokubakho usebenzisa i-javascript (ithebhu nganye kufuneka ivulwe ngokwayo):
- $ ( '#myTab a' ). cofa ( umsebenzi ( e ) {
- e . preventDefault ();
- $ ( oku ). ithebhu ( 'bonisa' );
- })
Unokwenza ithebhu nganye isebenze ngeendlela ezininzi:
- $ ( '#myTab a[href="#profile"]' ). ithebhu ( 'bonisa' ); // Khetha isithuba ngegama
- $ ( '#myTab a:first' ). ithebhu ( 'bonisa' ); // Khetha ithebhu yokuqala
- $ ( '#myTab a:last' ). ithebhu ( 'bonisa' ); // Khetha isithuba sokugqibela
- $ ( '#myTab li:eq(2) a' ). ithebhu ( 'bonisa' ); // Khetha ithebhu yesithathu (0-isalathisi)
Unokwenza ithebhu okanye ujongo lwepilisi ngaphandle kokubhala nayiphi na i-javascript ngokuchaza ngokulula data-toggle="tab"
okanye data-toggle="pill"
kwinto. Ukongeza i nav
kunye nav-tabs
neeklasi kwithebhu ul
kuya kusebenzisa isitayile sethebhu ye-bootstrap.
- <ul class = "nav nav-tabs" >
- <li><a href = "#ikhaya" data-toggle = "tab"> Ekhaya </a> < /li>
- <li><a href = "#profile" data-toggle = "tab"> Inkangeleko yesimo </a></li >
- <li><a href = "# imiyalezo" data-toggle = "tab"> Imiyalezo </a> < /li>
- <li><a href = "#settings" data-toggle = "tab"> Useto </a> </li>
- </ul>
Yenza isiqalelo sethebhu kunye nesiqulatho sisebenze. Isithuba kufuneka sibenendawo data-target
okanye indawo href
yesikhongozeli kwiDOM.
- <ul class = "nav nav-tabs" id = "myTab" >
- <li iklasi = "esebenzayo" > <a href = "#ikhaya"> Ekhaya </a></li>
- <li><a href = "#profile"> Inkangeleko yesimo </a></li>
- <li><a href = "#imiyalezo"> Imiyalezo </a> </li>
- <li><a href = "#iisetingi"> Useto </a> </li>
- </ul>
- <div class = "ithebhu-umxholo" >
- <div class = "i-tab-pane esebenzayo" id = "ikhaya" > ... </div>
- <div class = "i-tab-pane" id = "iprofayile" > ... </div>
- <div class = "i-tab-pane" id = "imiyalezo" > ... </div>
- <div class = "i-tab-pane" id = "iisetingi" > ... </div>
- </ div>
- <script>
- $ ( umsebenzi () {
- $ ( '#myTab a:last' ). ithebhu ( 'bonisa' );
- })
- </script>
Isiganeko | Inkcazo |
---|---|
bonisa | Esi siganeko sivutha kumboniso wethebhu, kodwa ngaphambi kokuba ithebhu entsha iboniswe. Sebenzisa event.target kunye event.relatedTarget nokujolisa isithuba esisebenzayo kunye nesithuba sangaphambili esisebenzayo (ukuba sikhona) ngokulandelelanayo. |
ibonisiwe | Esi siganeko sitshisa kwi-tab show emva kokuba ithebhu ibonisiwe. Sebenzisa event.target kunye event.relatedTarget nokujolisa isithuba esisebenzayo kunye nesithuba sangaphambili esisebenzayo (ukuba sikhona) ngokulandelelanayo. |
- $ ( 'a[data-toggle="tab"]' ). kwi ( 'ibonisiwe' , umsebenzi ( e ) {
- e . ekujoliswe kuko // ithebhu evuliwe
- e . relatedTarget // ithebhu yangaphambili
- })
Iphefumlelwe yi-plugin egqwesileyo ye-jQuery.tipsy ebhalwe nguJason Frame; Iingcebiso zesixhobo luguqulelo oluhlaziyiweyo, olungathembekanga kwimifanekiso, sebenzisa i-css3 yoopopayi, kunye neempawu zedatha zogcino lwesihloko sendawo.
Khuphela ifayileHambisa ngaphezulu kwezi linki zingezantsi ukuze ubone iingcebiso zesixhobo:
Iibhulukhwe eziqinileyo kwinqanaba elilandelayo keffiyeh mhlawumbi awuzange uve ngazo. Photo booth iindevu ekrwada idenim letterpress vegan messenger bag stumptown. Ifama-to-itheyibhile seitan, i-mcsweeney's fixie ezinzileyo iquinoa ye-8-bit yaseMelika isambatho sine - terry richardson vinyl chambray. Iindevu stumptown, cardigans banh mi lomo thundercats. Tofu biodiesel williamsburg marfa, four loko mcsweeney's cleanse vegan chambray. Igcisa elihlekisayo ngokwenene whatever keytar , i-scenar farm-to-table banksy Austin twitter handle freegan cred krwada idenim enye-origin ikofu viral.
Qalisa incam yesixhobo ngejavascript:
- $ ( '#example' ). incam yesixhobo ( iinketho )
Igama | uhlobo | ukungagqibeki | inkcazelo |
---|---|---|---|
oopopayi | boolean | yinyani | sebenzisa i-css fade inguqu kwisixhobo sesixhobo |
ukubekwa | umtya|umsebenzi | 'phezulu' | indlela yokubeka inqaku lesixhobo - phezulu | emazantsi | ekhohlo | kunene |
umkhethi | umtya | bubuxoki | Ukuba umkhethi unikiwe, izixhobo zesixhobo ziya kunikezelwa kwiithagethi ezichaziweyo. |
isihloko | umtya | umsebenzi | '' | ixabiso lesihloko esimiselweyo ukuba `isihloko` ithegi ayikho |
ukuxhokonxa | umtya | 'hamba phezulu' | ivuswa njani ithiphu yesixhobo - hambisa | gxila | incwadi yesandla |
ukulibazisa | inombolo | into | 0 | ukulibazisa ukubonisa kunye nokufihla incam yesixhobo (ms) - ayisebenzi kudidi lwesixhobo sokuxhobisa Ukuba inani linikiwe, ukulibaziseka kufakwa kuzo zombini ezifihla/umboniso Ulwakhiwo lwento yile: |
Ngenxa yezizathu zokusebenza, iSixhobo kunye nePopover data-apis zingenile.
- <a href = "#" rel = "isihloko sesixhobo" = "ingcebiso yesixhobo sokuqala"> hambisa phezu kwam </a>
Iqhoboshela isibambi sesixhobo kwingqokelela yesiqalelo.
Ityhila inqaku lesixhobo.
- $ ( '#isiqalelo' ). incam yesixhobo ( 'bonisa' )
Ifihla incam yesixhobo.
- $ ( '#isiqalelo' ). incam yesixhobo ( 'fihla' )
Itshintshela incam yesixhobo.
- $ ( '#isiqalelo' ). incam yesixhobo ( 'toggle' )
Yongeza imixholo emincinci, njengaleyo ikwi-iPad, kuyo nayiphi na into yolwazi lwesibini lwezindlu.
* Ifuna iNcwadana yesixhobo ukuba ibandakanywe
Khuphela ifayileHambisa ngaphezulu kweqhosha ukuqalisa ipopover.
Vumela iipopovers ngejavascript:
- $ ( '#example' ). popover ( iinketho )
Igama | uhlobo | ukungagqibeki | inkcazelo |
---|---|---|---|
oopopayi | boolean | yinyani | sebenzisa i-css fade inguqu kwisixhobo sesixhobo |
ukubekwa | umtya|umsebenzi | 'kunene' | indlela yokubeka popover - phezulu | emazantsi | ekhohlo | kunene |
umkhethi | umtya | bubuxoki | ukuba umkhethi unikiwe, izixhobo zesixhobo ziya kunikezelwa kwiithagethi ezichaziweyo |
ukuxhokonxa | umtya | 'hamba phezulu' | ivuswa njani ithiphu yesixhobo - hambisa | gxila | incwadi yesandla |
isihloko | umtya | umsebenzi | '' | ixabiso lesihloko esimiselweyo ukuba `isihloko` asikho uphawu loyelelwano |
umxholo | umtya | umsebenzi | '' | ixabiso lesiqulatho esingagqibekanga ukuba `umxholo wedatha` uphawu asikho |
ukulibazisa | inombolo | into | 0 | ukulibazisa ukubonisa kunye nokufihla i-popover (ms) - ayisebenzi kuhlobo lwe-trigger ye-manual Ukuba inani linikiwe, ukulibaziseka kufakwa kuzo zombini ezifihla/umboniso Ulwakhiwo lwento yile: |
Ngenxa yezizathu zokusebenza, iSixhobo kunye nePopover data-apis zingenile.
Uqalisa iipopovers zengqokelela yezinto.
Ityhila i-elementi popover.
- $ ( '#isiqalelo' ). popover ( 'bonisa' )
Ifihla i-elements popover.
- $ ( '#isiqalelo' ). popover ( 'fihla' )
Itshintshela izinto popover.
- $ ( '#isiqalelo' ). ipopover ( 'tshintsha' )
Iplagi yesilumkiso yiklasi encinci yokongeza ukusebenza ngokusondeleyo kwizilumkiso.
KhuphelaI-plugin yezilumkiso isebenza kwimiyalezo yesilumkiso rhoqo, kunye nemiyalezo yokubhloka.
Guqula le naleya kwaye uzame kwakhona. Duis mollis, est non commodo luctus, nisi erat porttitor ligula, eget lacinia odio sem nec elit. Cras mattis consectetur purus sit amet fermentum.
Vumela ukugxothwa kwesivuseleli ngejavascript:
- $ ( ".alert" ). lumkisa ()
Yongeza data-dismiss="alert"
nje kwiqhosha lakho lokuvala ukunika ngokuzenzekelayo umsebenzi okufutshane wesilumkiso.
- <a class = "close" data-dismiss = "alert" href = "#" > &amaxesha; </a>
Isonga zonke izilumkiso ngokusebenza ngokusondeleyo. Ukuze izilumkiso zakho ziphile xa zivaliwe, qiniseka ukuba zine .fade
kwaye .in
udidi sele lufakiwe kuzo.
Ivala isilumkiso.
- $ ( ".alert" ). lumkisa ( 'vala' )
Iklasi yesilumkiso ye-Bootstrap iveza iminyhadala embalwa yokuqhagamshelwa ekusebenzeni kwesilumkiso.
Isiganeko | Inkcazo |
---|---|
kufutshane | Esi siganeko sivutha ngokukhawuleza xa close kubizwa indlela yomzekelo. |
ivaliwe | Esi siganeko siyagxothwa xa isivuseleli sivaliwe (siya kulinda uguqulo lwe-css lugqibe). |
- $ ( '#isilumkiso sam' ). bopha ( 'ivaliwe' , umsebenzi () {
- // Yenza into…
- })
Fumana izitayile ezisisiseko kunye nenkxaso ebhetyebhetye kumacandelo aqengqelekayo anje ngeaccordion kunye nokuhamba.
Khuphela ifayile* Ifuna iplagin yeTransitions ukuba ibandakanywe.
Sisebenzisa iplagin yokuwa, sakhe iwijethi yesitayile esilula se-accordion:
Yenza ngejavascript:
- $ ( ".collapse" ). Ukuwa ()
Igama | uhlobo | ukungagqibeki | inkcazelo |
---|---|---|---|
umzali | umkhethi | bubuxoki | Ukuba umkhethi ke zonke izinto eziqengqelekayo phantsi komzali ochaziweyo ziya kuvalwa xa le nto iqengqelekayo iboniswa. (ifana nokuziphatha kwe-accordion yesiko) |
guqula | boolean | yinyani | Qwalasela into eqengqelekayo kubizo |
Yongeza nje data-toggle="collapse"
kunye ne- data-target
elementi ukunika ngokuzenzekelayo ulawulo lwento eqengqelekayo. Uphawu data-target
loyelelwano lwamkela umkhethi we-css ukuze kufakwe ukutshitshiswa. Qinisekisa ukuba wongeza iklasi collapse
kwinto eqengqelekayo. Ukuba ungathanda ukuba ivuleke ngokungagqibekanga, yongeza udidi olongezelelweyo in
.
- < iklasi yeqhosha = "btn btn-danger" data-toggle = "collapse" data-target = "#demo" >
- elula eqengqelekayo
- </ iqhosha>
- <div id = "idemo" iklasi = "ehla ngaphakathi" > … </div>
data-parent="#selector"
. Jonga kwidemo ukuze ubone oku kusebenza.
Yenza umxholo wakho ube yinto eqengqelekayo. Yamkela iinketho ozikhethelayo object
.
- $ ( '#myCollapsible' ). ukuwa ({
- guqula : bubuxoki
- })
Iguqulela into eqengqelekayo ukuze iboniswe okanye ifihliwe.
Ibonisa into eqengqelekayo.
Ifihla into eqengqelekayo.
Iklasi yokuwa yeBootstrap iveza iminyhadala embalwa yokuhuka ekusebenzeni kokuwa.
Isiganeko | Inkcazo |
---|---|
bonisa | Esi siganeko sivutha ngokukhawuleza xa show kubizwa indlela yomzekelo. |
ibonisiwe | Esi siganeko sigxothwa xa into yokudilika yenziwe yabonakala kumsebenzisi (iya kulinda i-css utshintsho ukuba igqibe). |
fihla | Esi siganeko sigxothwa ngokukhawuleza xa hide indlela sele ibizwa. |
efihliweyo | Esi siganeko siyagxothwa xa into yokudilika ifihliwe kumsebenzisi (iya kulinda uguqulo lwecss ukuba lugqibe). |
- $ ( '#myCollapsible' ). kwi ( 'ifihliwe' , umsebenzi () {
- // Yenza into…
- })
Jonga umboniso wesilayidi ongezantsi.
Fowuna ngejavascript:
- $ ( '.carousel' ). Icarousel ()
Igama | uhlobo | ukungagqibeki | inkcazelo |
---|---|---|---|
isithuba | inani | 5000 | Ubungakanani bexesha lokulibaziseka phakathi kokubhayisela ngokuzenzekelayo into. Ukuba ayiyonyani, i-carousel ayiyi kujikeleza ngokuzenzekelayo. |
nqumama | umtya | "bhabha" | Misa ukujikeleza kwecarousel kwi-mouseenter kwaye iqalise kwakhona ukujikeleza kwecarousel kwi-mouseleave. |
Iimpawu zedatha zisetyenziselwa ukulawulwa kwangaphambili kunye nokulandelayo. Jonga umzekelo ongezantsi.
- <div id = "myCarousel" iklasi = "icarousel isilayidi" >
- <!-- Izinto zeCarousel -->
- <div iklasi = "i-carousel-yangaphakathi" >
- <div class = "into esebenzayo" > ... </div>
- <div class = "into" > ... </div>
- <div class = "into" > ... </div>
- </ div>
- <!-- Carousel nav -->
- <a class = "carousel-control left" href = "#myCarousel" data-slide = "prev"> &lsaquo ; </a>
- <a class = "right carousel-control" href = "#myCarousel" data-slide = "elandelayo" > › </a>
- </ div>
Uqalisa i-carousel ngeendlela ozikhethelayo object
kwaye uqalise ukukhwela ibhayisekile kwizinto.
- $ ( '.carousel' ). icarousel ({
- Ikhefu : 2000
- })
Ujikeleza izinto zecarousel ukusuka ekhohlo ukuya ekunene.
Imisa ikhareshi ekukhweleni ibhayisekile kwizinto.
Ukujikelisa i-carousel kwisakhelo esithile (i-0 esekelwe, efana noluhlu).
Imijikelo ukuya kwinto yangaphambili.
Biyela ukuya kwinto elandelayo.
Iklasi ye-carousel ye-Bootstrap iveza iminyhadala emibini yokuhuka ekusebenzeni kwecarousel.
Isiganeko | Inkcazo |
---|---|
isilayidi | Esi siganeko sitshatyalaliswa ngoko nangoko xa kusenziwa slide indlela yomzekelo. |
tyibilika | Esi siganeko sigxothwa xa i-carousel igqibile inguqu yayo yesilayidi. |
I-plugin esisiseko, eyandisiweyo ngokulula yokwenza ngokukhawuleza iintloko zokuchwetheza ezintle ngalo naluphi na uhlobo lokufakwa kombhalo.
Khuphela ifayileQala ukuchwetheza kwintsimi engezantsi ukubonisa iziphumo zokuchwetheza.
Fowunela i-typeahead nge-javascript:
- $ ( '.typeahead' ). umphambili wokuchwetheza ()
Igama | uhlobo | ukungagqibeki | inkcazelo |
---|---|---|---|
umthombo | uluhlu | [ ] | Umthombo wedatha yokubuza ngokuchasene. |
izinto | inani | 8 | Elona nani liphezulu lezinto eziza kuboniswa kuluhlu. |
umenzi | umsebenzi | ityala alinaluvelwano | Indlela esetyenziswayo ukufumanisa ukuba umbuzo uhambelana nento. Yamkela ingxoxo enye, item apho kuvavanywa umbuzo. Fikelela kumbuzo wangoku nge this.query . Buyisela i-boolean true ukuba umbuzo uhambelana. |
umhleli | umsebenzi | ukuhambelana ngqo, uvakalelo lwetyala, ukungakhathali |
Indlela esetyenzisiweyo ukulungisa iziphumo ezizenzekelayo. Yamkela ingxoxo enye items kwaye inomda womzekelo wokuchwetheza. Jonga umbuzo wangoku nge this.query . |
i-highlighter | umsebenzi | iqaqambisa zonke iimatshisi ezimiselweyo | Indlela esetyenzisiweyo ukuqaqambisa iziphumo zokugqibezela ngokuzenzekelayo. Yamkela ingxoxo enye item kwaye inomda womzekelo wokuchwetheza. Kufuneka ibuyise i-html. |
Yongeza iimpawu zedatha ukubhalisa into enomsebenzi wokuchwetheza.
- <input type = "text" data-provide = "typeahead" >
Uqalisa igalelo nge-typeahead.