Kawo abubuwan haɗin Bootstrap zuwa rai-yanzu tare da 12 al'ada jQuery plugins.
Sauƙaƙe, amma mai sassauƙa, ɗauki kayan aikin javascript na al'ada tare da mafi ƙarancin aikin da ake buƙata kawai da rashin iyawa.
Ƙara menu na zaɓuka zuwa kusan komai a cikin Bootstrap tare da wannan plugin ɗin mai sauƙi. Bootstrap yana fasalta cikakken goyan bayan menu na zazzagewa akan navbar, shafuka, da kwayoyi.
Yi amfani da scrollspy don sabunta hanyoyin haɗin yanar gizon ta atomatik don nuna mahaɗin da ke aiki na yanzu dangane da matsayin gungurawa.
Yi amfani da wannan plugin ɗin don yin shafuka da kwayoyi masu amfani ta hanyar ƙyale su su juya ta cikin fakitin abun ciki na gida.
Wani sabon ɗauka a kan jQuery Tipsy plugin, Tooltips ba sa dogara da hotuna - suna amfani da CSS3 don rayarwa da sifofin bayanai don ajiyar take na gida.
Ƙara ƙarami mai rufi na abun ciki, kamar waɗanda ke kan iPad, zuwa kowane nau'i na bayanan sakandare na gidaje.
* Yana buƙatar haɗa na'urorin kayan aiki
Plugin faɗakarwa ƙaramin aji ne don ƙara ayyuka na kusa zuwa faɗakarwa.
Yi ƙari tare da maɓalli. Maɓallin sarrafawa ko ƙirƙiri ƙungiyoyin maɓalli don ƙarin abubuwan haɗin gwiwa kamar sandunan kayan aiki.
Sami salon tushe da sassauƙan tallafi don abubuwan haɗin gwiwa masu rugujewa kamar accordions da kewayawa.
Ƙirƙiri zagaye-zagaye mai daɗi na kowane abun ciki da kuke so don samar da nunin faifai na abun ciki.
Ainihin plugin ɗin mai sauƙi mai sauƙi don ƙirƙirar ƙayatattun rubutun rubutu tare da kowane nau'i na shigar da rubutu.
Don sauƙaƙan tasirin canji, haɗa da bootstrap-transition.js sau ɗaya don zamewa a cikin tsari ko fashe faɗakarwa.
* Ana buƙata don rayarwa a cikin plugins
Sauƙaƙe, amma mai sassauƙa, ɗauki kayan aikin javascript na al'ada tare da mafi ƙarancin aikin da ake buƙata kawai da rashin iyawa.
Zazzage fayilA ƙasa akwai ƙirar ƙididdiga.
Jiki mai kyau…
Juya modal ta javascript ta danna maɓallin da ke ƙasa. Zai zame ƙasa ya dushe daga saman shafin.
Kaddamar demo modalKira modal ta hanyar javascript:
- $ ( '#myModal' ). modal ( zaɓi )
Suna | nau'in | tsoho | bayanin |
---|---|---|---|
baya | boolean | gaskiya | Ya ƙunshi nau'in modal-backdrop. A madadin, saka static don bayanan baya wanda baya rufe tsarin a dannawa. |
keyboard | boolean | gaskiya | Yana rufe tsarin lokacin da aka danna maɓallin guduwa |
nuna | boolean | gaskiya | Yana nuna tsarin lokacin farawa. |
Kuna iya kunna modals akan shafinku cikin sauƙi ba tare da rubuta layi ɗaya na javascript ba. Kawai saita data-toggle="modal"
kan abin sarrafawa tare da data-target="#foo"
ko href="#foo"
wanda yayi daidai da nau'in nau'in ID, kuma lokacin da aka danna, zai ƙaddamar da tsarin ku.
Hakanan, don ƙara zaɓuɓɓuka zuwa misalin ƙirar ku, kawai haɗa su azaman ƙarin sifofin bayanai akan ko dai ɓangaren sarrafawa ko alamar yanayin kanta.
- <a class = "btn" data-toggle = "modal" href = "#myModal" > Ƙaddamar da Modal </a>
- <div class = "modal hide" id = "myModal" >
- <div class = "modal-header" >
- <button type = "button" class = "rufe" data-dismiss = "modal" > × </button>
- <h3> Modal header </h3>
- </div>
- <div class = "modal-body" >
- <p> Jiki mai kyau… </p>
- </div>
- <div class = "modal-footer" >
- <a href = "#" class = "btn" data-dismiss = "modal" > Rufe </a>
- <a href = "#" class = "btn btn-primary" > Ajiye canje-canje </a>
- </div>
- </div>
.fade
aji zuwa
.modal
kashi (koma zuwa demo don ganin wannan a aikace) kuma haɗa da bootstrap-transition.js.
Yana kunna abun cikin ku azaman tsari. Yana yarda da zaɓin zaɓi object
.
- $ ( '#myModal' ). modal ({
- keyboard : karya
- })
Da hannu yana jujjuya modal.
- $ ( '#myModal' ). modal ( 'juya' )
Da hannu yana buɗe modal.
- $ ( '#myModal' ). modal ( 'show' )
Da hannu yana ɓoye modal.
- $ ( '#myModal' ). modal ( 'boye' )
Ajin modal na Bootstrap yana fallasa ƴan abubuwan da suka faru don haɗawa cikin ayyukan modal.
Lamarin | Bayani |
---|---|
nuna | Wannan taron yana gobara nan da nan lokacin da show aka kira hanyar misali. |
nunawa | Ana korar wannan taron lokacin da aka bayyana yanayin ga mai amfani (zai jira canjin css don kammala). |
boye | Ana korar wannan taron nan da nan lokacin da hide aka kira hanyar misali. |
boye | Ana kora wannan taron lokacin da tsarin ya gama ɓoyewa daga mai amfani (zai jira canjin css don kammala). |
- $ ( '#myModal' ). akan ( 'boye' , aiki () {
- // yi wani abu…
- })
Ƙara menu na zaɓuka zuwa kusan komai a cikin Bootstrap tare da wannan plugin ɗin mai sauƙi. Bootstrap yana fasalta cikakken goyan bayan menu na zazzagewa akan navbar, shafuka, da kwayoyi.
Zazzage fayilDanna mahaɗin mahaɗan nav na zazzagewa a cikin navbar da kwayayen da ke ƙasa don gwada zazzagewar.
Kira jerin zaɓuka ta hanyar javascript:
- $ ( '. dropdown-toggle' ). zazzagewa ()
Don ƙara aikin zazzagewa da sauri zuwa kowane kashi kawai ƙara data-toggle="dropdown"
kuma kowane ingantaccen zazzage zazzagewar bootstrap za a kunna ta atomatik.
data-target="#fat"
ko
href="#fat"
.
- <ul class = "nav nav-pills" >
- <li class = "active" ><a href = "#" > Haɗin kai na yau da kullun </a></li>
- <li class = "zazzagewa" id = "menu1" >
- <a class = "dropdown-toggle" data-toggle = "saukarwa" href = "#menu1" >
- Zazzagewa
- <b class = "kulawa" </b>
- </a>
- <ul class = "zazzage-menu" >
- <li><a href = "#" > Aiki </a></li>
- <li><a href = "#" > Wani aiki </a></li>
- <li><a href = "#" > Wani abu kuma anan </a></li>
- <li class = "mai rarrabawa" </li>
- <li><a href = "#" > Rabuwar hanyar haɗin gwiwa </a></li>
- </ul>
- </li>
- ...
- </ul>
Don kiyaye URLs daidai, yi amfani da data-target
sifa maimakon href="#"
.
- <ul class = "nav nav-pills" >
- <li class = "saukarwa" >
- <a class = "dropdown-toggle" data-toggle = "saukarwa" data-target = "#" href = "hanya/zuwa/shafi.html" >
- Zazzagewa
- <b class = "kulawa" </b>
- </a>
- <ul class = "zazzage-menu" >
- ...
- </ul>
- </li>
- </ul>
API ɗin shirye-shirye don kunna menus don navbar da aka bayar ko kewayawa tabbed.
The ScrollSpy plugin shine don sabunta makasudin nav ta atomatik dangane da matsayin gungurawa.
Zazzage fayilGungura wurin da ke ƙasa kuma duba sabunta kewayawa. Za a kuma haskaka ƙananan abubuwan da aka zazzage su ma. Gwada shi!
Ad leggings keytar, brunch id art party dolor labour. Pitchfork yr enim lo-fi kafin su sayar da qui. Tumblr gona-zuwa tebur haƙƙin keke komai. Anim keffiyeh carles cardigan. Velit seitan mcsweeney's photo booth 3 wolf moon irure. Cosby suwaita lomo Jean shorts, williamsburg hoodie minim qui mai yiwuwa ba ku ji labarin su ba da cardigan Trust fund culpa biodiesel wes anderson aesthetical. Nihil tattooed accusamus, cred irony biodiesel keffiyeh artisan ullamco consequat.
Veniam marfa gashin baki skateboard, adipisicing fugiat velit pitchfork gemu. Freegan gemu aliqua cupidatat mcsweeney's vero. Cupidatat guda huɗu loko nisi, da helvetica nulla carles. Tattooed cosby sweater truck abinci, mcsweeney's quis non freegan vinyl. Lo-fi wes anderson +1 sartorial. Carles ba kayan motsa jiki ba yana da kyau. Brooklyn adipisicing craft giya mataimakin keytar desrunt.
Occaecat commodo aliqua delectus. Fap craft giya deserunt skateboard ea. Haƙƙin keke na Lomo adipisicing banh mi, velit ea sunt next level locavore kofi mai asali guda a magna veniam. High life id vinyl, echo park consequat quis aliquip banh mi pitchfork. Vero VHS yana da matukar damuwa. Consectetur nisi DIY minim jakar jaka. Cred ex in, dorewa delectus consectetur fanny fakitin 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 messenger jakar marfa duk abin da motar abinci ta delectus. Sapiente synth id zatonnda. Locavore sed helvetica cliche irony, tsawa mai yiwuwa ba ku ji labarin su ba sakamakon hoodie gluten-free lo-fi fap aliquip. Labour elit placeat kafin su sayar da su, Terry Richardson proident brunch nesciunt quis cosby suweter pariatur keffiyeh ut helvetica artisan. Cardigan craft giya seitan readymade velit. VHS chambray labs na dan lokaci veniam. Anim mollit minim commodo ullamco thundercats.
Kira scrollspy ta hanyar javascript:
- $ ( '#navbar' ). scrollspy ()
Don sauƙaƙe ƙara halayyar scrollspy zuwa kewayawa na sama, kawai ƙara data-spy="scroll"
zuwa kashi da kuke son yin rahõto a kai (mafi yawanci wannan zai zama jiki).
- <body data-spy = "gungurawa" > ... </ jiki>
<a href="#home">home</a>
dole ne ya dace da wani abu a cikin gidan kamar
<div id="home"></div>
.
Lokacin amfani da scrollspy tare da ƙara ko cire abubuwa daga DOM, kuna buƙatar kiran hanyar wartsakewa kamar haka:
- $ ( '[data-leken asiri = " gungura"]' ). kowane ( aiki () {
- var $ Spy = $ ( wannan ). scrollspy ( 'refresh' )
- });
Suna | nau'in | tsoho | bayanin |
---|---|---|---|
biya diyya | lamba | 10 | Pixels don kashewa daga sama yayin ƙididdige matsayi na gungurawa. |
Lamarin | Bayani |
---|---|
kunna | Wannan taron yana ƙonewa a duk lokacin da sabon abu ya kunna ta hanyar gungurawa. |
Wannan plugin ɗin yana ƙara sauri, shafi mai ƙarfi da aikin kwaya don canzawa ta abun cikin gida.
Zazzage fayilDanna shafukan da ke ƙasa don kunna tsakanin ɓoyayyun fa'idodin, ko da ta hanyar menu na zazzagewa.
Raw denim mai yiwuwa ba ku ji labarin su jeans shorts Austin ba. Nesciunt tofu stumptown aliqua, retro synth master cleanse. gashin baki cliche tempor, williamsburg carles vegan helvetica. Reprehenderit mahauci retro keffiyeh dreamcatcher synth. Cosby suwaita eu banh mi, qui irure terry richardson ex squid. Yadda ake yin salvia cillum iphone. Seitan aliquip quis cardigan Amurka tufafi, mahauta 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 kafin su sayar da master cleanse gluten-free squid scenester freegan cosby sweater. Fanny fakitin Portland seitan DIY, liyafa na fasaha locavore wolf cliche high life echo park Austin. Cred vinyl keffiyeh DIY salvia PBR, banh mi kafin su sayar da gona-zuwa tebur VHS viral locavore cosby suwaita. Lomo wolf viral, gashin baki readymade thundercats keffiyeh craft giya marfa xa'a. Wolf salvia freegan, sartorial keffiyeh echo park vegan.
Kunna tabbbable shafuka ta hanyar javascript (kowane shafin yana buƙatar kunna shi daban):
- $ ( '#myTab a' ). danna ( aikin ( e ) {
- e . default ();
- $ ( wannan ). tab ( 'show' );
- })
Kuna iya kunna shafuka guda ɗaya ta hanyoyi da yawa:
- $ ( '#myTab a[href="#profile"]' ). tab ( 'show' ); // Zaɓi shafin da suna
- $ ( '#myTab a: farko' ). tab ( 'show' ); // Zaɓi shafin farko
- $ ( '#myTab a: karshe' ). tab ( 'show' ); // Zaɓi shafin ƙarshe
- $ ( '#myTab li:eq(2) a' ). tab ( 'show' ); // Zaɓi shafin na uku (0-indexed)
Kuna iya kunna kewayawa tab ko kwaya ba tare da rubuta kowane javascript ba ta hanyar tantancewa kawai data-toggle="tab"
ko data-toggle="pill"
akan wani abu. Ƙara nav
da nav-tabs
azuzuwan zuwa shafin ul
zai yi amfani da salo na bootstrap.
- <ul class = "nav nav-tabs" >
- <li><a href = "#home" data-toggle = "tab" > Gida </a></li>
- <li><a href = "#profile" data-toggle = "tab" > Bayanan martaba </a></li>
- <li><a href = "#messages" data-toggle = "tab" > Saƙonni </a></li>
- <li><a href = "#settings" data-toggle = "tab" > Saituna </a></li>
- </ul>
Yana kunna abun shafi da kwandon abun ciki. Tab ya kamata ya kasance yana da ko dai data-target
ko wani href
kumburin kwantena mai niyya a cikin DOM.
- <ul class = "nav nav-tabs" id = "myTab" >
- <li class = "active" ><a href = "#gida" > Gida </a></li>
- <li><a href = "#profile" > Bayanan martaba </a></li>
- <li><a href = "#messages" > Saƙonni </a></li>
- <li><a href = "#Settings" > Saituna </a></li>
- </ul>
- <div class = "tab-content" >
- <div class = "tab-pane active" id = "gida" > ... </div>
- <div class = "tab-pane" id = "profile" > ... </div>
- <div class = "tab-pane" id = "saƙonni" > ... </div>
- <div class = "tab-pane" id = "saituna" > ... </div>
- </div>
- <rubutu>
- $ ( aiki () {
- $ ( '#myTab a: karshe' ). tab ( 'show' );
- })
- </script>
Lamarin | Bayani |
---|---|
nuna | Wannan taron yana gobara akan nunin shafin, amma kafin a nuna sabon shafin. Yi amfani event.target da event.relatedTarget niyya shafi mai aiki da shafin mai aiki da ya gabata (idan akwai) bi da bi. |
nunawa | Wannan taron yana gobara akan nunin shafin bayan an nuna shafin. Yi amfani event.target da event.relatedTarget niyya shafi mai aiki da shafin mai aiki da ya gabata (idan akwai) bi da bi. |
- $ ( 'a[data-toggle = "tab"]' ). kan ( 'an nuna' , aiki ( e ) {
- e . manufa // kunna tab
- e . relatedTarget // shafi na baya
- })
Ƙaddamar da kyakkyawan jQuery.tipsy plugin wanda Jason Frame ya rubuta; Tukwici kayan aiki sigar da aka sabunta ne, waɗanda ba su dogara da hotuna ba, yi amfani da css3 don rayarwa, da sifofin bayanai don ajiyar take na gida.
Zazzage fayilTsallake kan hanyoyin da ke ƙasa don ganin kayan aiki:
Wando mai tauri next level keffiyeh kila baka ji labarin su ba. Hoton rumfar gemu raw denim wasiƙar vegan messenger jakar stumptown. Farm-to-tebur seitan, mcsweeney's fixie dorewa quinoa 8-bit tufafin Amurka suna da terry Richardson vinyl chambray. Gemu stumptown, cardigans banh mi lomo thundercats. Tofu biodiesel williamsburg marfa, hudu loko mcsweeney's tsabtace vegan chambray. A really ironic artisan whatever keytar , scenester farm-to-table banksy Austin twitter handle freegan cred raw denim single-origin kofi viral.
Ƙaddamar da kayan aiki ta hanyar javascript:
- $ ( '#misali' ). kayan aiki ( zaɓi )
Suna | nau'in | tsoho | bayanin |
---|---|---|---|
tashin hankali | boolean | gaskiya | Yi amfani da canjin css fade zuwa tip ɗin kayan aiki |
jeri | string | aiki | ' saman' | yadda ake saka kayan aiki - saman | kasa | hagu | dama |
mai zaɓe | kirtani | karya | Idan an samar da mai zaɓe, za a ba da abubuwan da suka shafi kayan aiki zuwa takamaiman maƙasudai. |
take | zaren | aiki | '' | Tsohuwar darajar take idan alamar ` take` ba ta nan |
jawo | kirtani | 'tsayawa' | yadda ake kunna kayan aiki - hover | mayar da hankali | manual |
jinkiri | lamba | abu | 0 | jinkirin nunawa da ɓoye kayan aiki (ms) - baya aiki ga nau'in faɗakarwa na hannu Idan an ba da lamba, ana amfani da jinkiri ga duka ɓoye/nunawa Tsarin abu shine: |
Don dalilan aiki, Tooltip da Popover data-apis sun shiga ciki. Idan kuna son amfani da su kawai saka zaɓin zaɓi.
- <a href = "#" rel = "tooltip" take = "farkon kayan aiki" > shawagi a kaina </a>
Haɗa mai sarrafa kayan aiki zuwa tarin abubuwa.
Yana bayyana matakin kayan aiki.
- $ ( '# element' ). kayan aiki ( 'show' )
Yana ɓoye bayanan kayan aiki.
- $ ( '# element' ). kayan aiki ( 'boye' )
Yana jujjuya matakin kayan aiki.
- $ ( '# element' ). Tooltip ( 'canzawa' )
Ƙara ƙarami mai rufi na abun ciki, kamar waɗanda ke kan iPad, zuwa kowane nau'i na bayanan sakandare na gidaje.
* Yana buƙatar haɗa kayan aiki
Zazzage fayilJuya kan maɓallin don kunna popover.
Kunna popovers ta hanyar javascript:
- $ ( '#misali' ). popover ( zaɓi )
Suna | nau'in | tsoho | bayanin |
---|---|---|---|
tashin hankali | boolean | gaskiya | Yi amfani da canjin css fade zuwa tip ɗin kayan aiki |
jeri | string | aiki | 'dama' | yadda ake sanya popover - top | kasa | hagu | dama |
mai zaɓe | kirtani | karya | idan an samar da mai zaɓe, za a ba da abubuwan da suka shafi kayan aiki zuwa ga takamaiman maƙasudin |
jawo | kirtani | 'tsayawa' | yadda ake kunna kayan aiki - hover | mayar da hankali | manual |
take | zaren | aiki | '' | Tsohuwar darajar take idan sifa ' take' ba ta nan |
abun ciki | zaren | aiki | '' | Tsohuwar ƙimar abun ciki idan 'abun cikin bayanai' ba ya kasancewa |
jinkiri | lamba | abu | 0 | jinkirin nunawa da ɓoye popover (ms) - baya shafi nau'in fararwa na hannu Idan an ba da lamba, ana amfani da jinkiri ga duka ɓoye/nunawa Tsarin abu shine: |
Don dalilan aiki, Tooltip da Popover data-apis sun shiga ciki. Idan kuna son amfani da su kawai saka zaɓin zaɓi.
Yana farawa popovers don tarin abubuwa.
Yana bayyanar da abubuwa masu tasowa.
- $ ( '# element' ). popover ( 'show' )
Yana ɓoye abubuwan haɓakawa.
- $ ( '# element' ). popover ( 'boye' )
Yana jujjuya abubuwan haɓakawa.
- $ ( '# element' ). popover ( 'canzawa' )
Fitin ɗin faɗakarwa yana aiki akan saƙonnin faɗakarwa na yau da kullun, kuma yana toshe saƙonni.
Canza wannan da wancan kuma a sake gwadawa. Duis mollis, est non commodo luctus, nisi erat porttitor ligula, eget lacinia odio sem nec elit. Cras Mattis consectetur purus zauna amet fermentum.
Kunna korar faɗakarwa ta hanyar javascript:
- $ ( "jijjiga" ). faɗakarwa ()
Kawai ƙara data-dismiss="alert"
zuwa maɓallin ku don ba da aikin kusa da faɗakarwa ta atomatik.
- <a class = "close" data-dismiss = "alert" href = "#" > × </a>
Yana tattara duk faɗakarwa tare da ayyuka na kusa. Don faɗakarwar ku ta raye lokacin rufewa, tabbatar cewa an riga an yi amfani .fade
da .in
ajin da ajin.
Yana rufe faɗakarwa.
- $ ( "jijjiga" ). faɗakarwa ( 'kusa' )
Ajin faɗakarwa na Bootstrap yana fallasa ƴan abubuwan da suka faru don haɗawa cikin ayyukan faɗakarwa.
Lamarin | Bayani |
---|---|
kusa | Wannan taron yana gobara nan da nan lokacin da close aka kira hanyar misali. |
rufe | Ana kunna wannan taron lokacin da aka rufe faɗakarwa (zai jira canjin css don kammala). |
- $ ( '#ajiya na' ). ɗaure ( 'rufe' , aiki () {
- // yi wani abu…
- })
Sami salon tushe da sassauƙan tallafi don abubuwan haɗin gwiwa masu rugujewa kamar accordions da kewayawa.
Zazzage fayil* Yana buƙatar plugin ɗin Transition don haɗawa.
Yin amfani da plugin ɗin rushewa, mun gina widget ɗin salon accordion mai sauƙi:
Kunna ta hanyar javascript:
- $ ( ".rushe" ). rugujewa ()
Suna | nau'in | tsoho | bayanin |
---|---|---|---|
iyaye | mai zaɓe | karya | Idan mai zaɓi to duk abubuwan da za su iya haɗuwa a ƙarƙashin ƙayyadadden iyaye za a rufe su lokacin da aka nuna wannan abu mai yuwuwa. (mai kama da dabi'un gargajiya na gargajiya) |
juya | boolean | gaskiya | Yana kunna abin da zai iya rushewa akan kira |
Kawai ƙara data-toggle="collapse"
da kuma data-target
zuwa kashi don ba da ikon sarrafa abin da zai iya rugujewa ta atomatik. Siffar data-target
tana karɓar mai zaɓin css don amfani da rushewar zuwa. Tabbatar ƙara ajin collapse
zuwa kashi mai rugujewa. Idan kuna son buɗewa ta tsohuwa, ƙara ƙarin ajin in
.
- <button class = "btn btn-danger" data-toggle = "rushewa" data-target = "#demo" >
- sauki rugujewa
- </button>
- <div id = "demo" class = "rushewa" > … </div>
data-parent="#selector"
. Koma zuwa demo don ganin wannan a aikace.
Yana kunna abun cikin ku azaman abin da zai iya rugujewa. Yana yarda da zaɓin zaɓi object
.
- $ ( '#myCollapsible' ). rugujewa ({
- juya : karya
- })
Yana juya wani abu mai rugujewa zuwa nunawa ko ɓoye.
Yana nuna kashi mai rugujewa.
Yana ɓoye wani abu mai rugujewa.
Ajin rushewar Bootstrap yana fallasa ƴan abubuwan da suka faru don haɗawa cikin ayyukan rugujewa.
Lamarin | Bayani |
---|---|
nuna | Wannan taron yana gobara nan da nan lokacin da show aka kira hanyar misali. |
nunawa | Ana korar wannan taron lokacin da aka bayyana ɓangaren rugujewa ga mai amfani (zai jira canjin css ya kammala). |
boye | Ana korar wannan taron nan da nan lokacin da hide aka kira hanyar. |
boye | Ana kora wannan taron lokacin da aka ɓoye ɓoyayyiyar ɓarna daga mai amfani (zai jira canjin css don kammala). |
- $ ( '#myCollapsible' ). akan ( 'boye' , aiki () {
- // yi wani abu…
- })
Kalli nunin faifai a kasa.
Kira ta javascript:
- $ ( '.carousel' ). carousel ()
Suna | nau'in | tsoho | bayanin |
---|---|---|---|
tazara | lamba | 5000 | Adadin lokacin jinkirta tsakanin yin keke ta atomatik abu. Idan karya, carousel ba zai sake zagayawa ta atomatik ba. |
dakatarwa | kirtani | "tsayawa" | Yana dakatar da hawan keke na carousel akan linzamin linzamin kwamfuta kuma ya ci gaba da hawan keke na carousel a kan tafin linzamin kwamfuta. |
Ana amfani da sifofin bayanai don na baya da na gaba. Duba alamar misali a ƙasa.
- <div id = "myCarousel" class = "carousel slide" >
- <!-- Abubuwan Carousel -->
- <div class = "carousel-inner" >
- <div class = "abu mai aiki" > … </div>
- <div class = "abu" > … </div>
- <div class = "abu" > … </div>
- </div>
- <!-- Carousel nav -->
- <a class = "carousel-control hagu" href = "#myCarousel" data-slide = "prev" > ‹ </a>
- <a class = "carousel-control right" href = "#myCarousel" data-slide = "na gaba" > & rsaquo; </a>
- </div>
Ya fara carousel tare da zaɓin zaɓi object
kuma ya fara hawan keke ta abubuwa.
- $ ( '.carousel' ). carousel ({
- tazara : 2000
- })
Yana zagayawa cikin abubuwan carousel daga hagu zuwa dama.
Yana dakatar da carousel daga yin keke ta cikin abubuwa.
Yana zagayawa carousel zuwa wani firam na musamman (0 tushen, kama da tsararru).
Kewaya zuwa abu na baya.
Kewaya zuwa abu na gaba.
Ajin carousel na Bootstrap yana fallasa abubuwa biyu don haɗawa cikin ayyukan carousel.
Lamarin | Bayani |
---|---|
zamewa | Wannan taron yana buɗewa nan da nan lokacin da slide aka kira hanyar misali. |
zamiya | Ana korar wannan taron lokacin da carousel ya gama ƙaddamar da zamewar sa. |
Ainihin plugin ɗin mai sauƙi mai sauƙi don ƙirƙirar ƙayatattun rubutun rubutu tare da kowane nau'i na shigar da rubutu.
Zazzage fayilFara bugawa a cikin filin da ke ƙasa don nuna sakamakon rubutu.
Kira typeahead ta hanyar javascript:
- $ ( '.typehead' ). irin ()
Suna | nau'in | tsoho | bayanin |
---|---|---|---|
tushe | tsararru | [] | Tushen bayanan don tambaya akan. |
abubuwa | lamba | 8 | Matsakaicin adadin abubuwan da za a nuna a cikin zaɓuka. |
mai daidaitawa | aiki | yanayin rashin jin daɗi | Hanyar da ake amfani da ita don tantance idan tambaya ta dace da abu. Ya yarda da hujja guda ɗaya, item wacce za a gwada tambayar. Samun damar tambayar yanzu tare da this.query . Koma boolean true idan tambaya ta dace. |
mai rarrabawa | aiki | daidai wasa, yanayin yanayi, yanayin rashin jin daɗi |
Hanyar da ake amfani da ita don warware sakamakon da aka kammala ta atomatik. Ya yarda da hujja guda ɗaya items kuma yana da iyakar misalin nau'in rubutu. Yi magana da tambayar yanzu tare da this.query . |
mai haskakawa | aiki | yana haskaka duk tsoffin matches | Hanyar da aka yi amfani da ita don haskaka sakamakon da aka kammala ta atomatik. Ya yarda da hujja guda ɗaya item kuma yana da iyakar misalin nau'in rubutu. Ya kamata a dawo da html. |
Ƙara sifofin bayanai don yin rajistar wani kashi mai aikin nau'in rubutu.
- < nau'in shigarwa = "rubutu" data- provide = "typehead" >
Yana fara shigarwa tare da nau'in rubutu.