Bweretsani zida za Bootstrap - tsopano ndi mapulagini 12 a jQuery .
Chosavuta, koma chosinthika, tengerani javascript modal plugin yokhala ndi magwiridwe antchito ochepa komanso zosasintha zanzeru.
Onjezani mindandanda yotsitsa pafupifupi chilichonse mu Bootstrap ndi pulogalamu yowonjezera iyi. Bootstrap imakhala ndi chithandizo chonse cha menyu otsikira pa navbar, ma tabo, ndi mapiritsi.
Gwiritsani ntchito scrollspy kuti musinthe maulalo omwe ali mu navbar yanu kuti muwonetse ulalo womwe ukugwira ntchito potengera malo opukutu.
Gwiritsani ntchito pulogalamu yowonjezerayi kuti mupange ma tabo ndi mapiritsi kukhala othandiza powalola kuti azitha kusuntha pazigawo zowoneka bwino zazomwe zili kwanuko.
Kutenga kwatsopano pa pulogalamu yowonjezera ya jQuery Tipsy, Tooltips sadalira zithunzi-amagwiritsira ntchito CSS3 pazithunzithunzi ndi mawonekedwe a deta posungira mitu yanu.
Onjezani zophatikizika zazing'ono, monga zomwe zili pa iPad, kuzinthu zilizonse zachidziwitso chachiwiri.
* Imafunikira Tooltips kuti iphatikizidwe
Pulagi yochenjeza ndi kagulu kakang'ono kowonjezera magwiridwe antchito ku zidziwitso.
Chitani zambiri ndi mabatani. Batani lowongolera likunena kapena pangani magulu a mabatani azinthu zambiri ngati zida.
Pezani masitayelo oyambira ndi chithandizo chosinthika cha zinthu zomwe zimatha kugwa monga ma accordion ndi navigation.
Pangani zosewerera zilizonse zomwe mukufuna kuti mupereke chiwonetsero chazithunzi chazomwe zili.
Pulagi yoyambira, yotalikira mosavuta yopangira mwachangu zilembo zokongola ndi mawu amtundu uliwonse.
Pazosintha zosavuta, phatikizani bootstrap-transition.js kamodzi kuti mutsike mu modals kapena kuzimitsa zidziwitso.
* Zofunikira pa makanema ojambula pamapulagini
Chosavuta, koma chosinthika, tengerani javascript modal plugin yokhala ndi magwiridwe antchito ochepa komanso zosasintha zanzeru.
Tsitsani fayiloPansipa pali statically kumasuliridwa modal.
Thupi limodzi labwino…
Sinthani modal kudzera pa javascript podina batani pansipa. Idzatsika ndikuzimiririka kuchokera pamwamba pa tsamba.
Yambitsani demo modalImbani modal kudzera pa javascript:
- $ ( '#myModal' ). modali ( zosankha )
Dzina | mtundu | kusakhulupirika | kufotokoza |
---|---|---|---|
kumbuyo | boolean | zoona | Mulinso modal-backdrop element. Kapenanso, tchulani static zakumbuyo zomwe sizitseka moduli mukadina. |
kiyibodi | boolean | zoona | Amatseka modali pamene kiyi yothawa ikanikizidwa |
chiwonetsero | boolean | zoona | Imawonetsa modali ikayambika. |
Mutha kuyambitsa ma mods patsamba lanu mosavuta popanda kulemba mzere umodzi wa javascript. Ingoyikani data-toggle="modal"
pa chinthu chowongolera chokhala ndi data-target="#foo"
kapena href="#foo"
chomwe chikufanana ndi id ya chinthu cha modal, ndipo mukadina, imayambitsa modal yanu.
Komanso, kuti muwonjezere zosankha pamwambo wanu wa modal, ingowaphatikiza ngati zowonjezera za data paziwongolero kapena ma modal markup omwe.
- <a class = "btn" data-toggle = "modal" href = "#myModal"> Launch Modal </a>
- <div class = "modal hide" id = "myModal" >
- <div class = "modal-header" >
- <button type = "button" class = "close" data-dismiss = "modal" > × </button>
- <h3> Mutu wamutu </h3>
- </div>
- <div class = "modal-body" >
- <p> Thupi limodzi labwino… </p>
- </div>
- <div class = "modal-footer" >
- <a href = "#" class = "btn" data-dismiss = "modal"> Tsekani </a> _
- <a href = "#" class = "btn btn-primary"> Sungani zosintha </a>
- </div>
- </div>
.fade
kalasi ku
.modal
chinthucho (onani chiwonetserochi kuti muwone izi zikugwira ntchito) ndikuphatikiza bootstrap-transition.js.
Imayambitsa zomwe zili ngati modal. Imavomereza zomwe mungachite object
.
- $ ( '#myModal' ). modali ({
- keyboard : zabodza
- })
Imatembenuza pamanja modali.
- $ ( '#myModal' ). modali ( 'toggle' )
Pamanja amatsegula modali.
- $ ( '#myModal' ). modali ( 'show' )
Amabisa pamanja modali.
- $ ( '#myModal' ). modali ( 'hide' )
Kalasi ya modal ya Bootstrap imawulula zochitika zingapo kuti zigwirizane ndi machitidwe a modal.
Chochitika | Kufotokozera |
---|---|
chiwonetsero | Chochitika ichi chimayaka nthawi yomweyo show njira yachitsanzo itayitanidwa. |
zowonetsedwa | Chochitikachi chimachotsedwa pomwe modal yawonetsedwa kwa wogwiritsa ntchito (idikirira kuti kusintha kwa css kumalize). |
kubisa | Chochitika ichi chimachotsedwa nthawi yomweyo pamene hide njira yachitsanzo yayitanidwa. |
zobisika | Chochitikachi chimachotsedwa pomwe modal yatha kubisidwa kwa wogwiritsa ntchito (idikirira kuti kusintha kwa css kumalize). |
- $ ( '#myModal' ). pa ( 'zobisika' , ntchito () {
- // kuchitapo kanthu...
- })
Onjezani mindandanda yotsitsa pafupifupi chilichonse mu Bootstrap ndi pulogalamu yowonjezera iyi. Bootstrap imakhala ndi chithandizo chonse cha menyu otsikira pa navbar, ma tabo, ndi mapiritsi.
Tsitsani fayiloDinani pa maulalo otsikirapo mu navbar ndi mapiritsi omwe ali pansipa kuti muyese kutsitsa.
Imbani zotsitsa kudzera pa javascript:
- $ ( '. dropdown-toggle' ). kutsika ()
Kuti muwonjezere magwiridwe antchito ku chinthu data-toggle="dropdown"
chilichonse ingowonjezerani ndipo kutsitsa kulikonse kovomerezeka kwa bootstrap kumangotsegulidwa.
data-target="#fat"
kapena
href="#fat"
.
- <ul class = "mapiritsi a nav-nav" >
- <li class = "active" > <a href = "#"> Ulalo wokhazikika </a></li>
- <li class = "dropdown" id = "menu1" >
- <a class = "dropdown-toggle" data-toggle = "dropdown" href = "#menu1"> _
- Tsitsa m'munsi
- <b class = "caret" > </b>
- </a>
- <ul class = "dropdown-menu" >
- <li><a href = "#"> Zochita </a> </li>
- <li><a href = "#"> Zochita zina </a></li>
- <li><a href = "#"> Chinachake apa </a></li>
- <li class = "divider" > </li>
- <li><a href = "#"> Ulalo wolekanitsidwa </a> </li>
- </ul>
- </li>
- ...
- </ul>
Kuti ma URL asasinthe, gwiritsani ntchito mawonekedwewo data-target
m'malo mwa href="#"
.
- <ul class = "mapiritsi a nav-nav" >
- <li class = "dropdown" >
- <a class = "dropdown-toggle" data-toggle = "dropdown" data-target = "#" href = "path/to/page.html"> _
- Tsitsa m'munsi
- <b class = "caret" > </b>
- </a>
- <ul class = "dropdown-menu" >
- ...
- </ul>
- </li>
- </ul>
Pulogalamu ya api yotsegulira ma menus a navbar yopatsidwa kapena navigation ya tabbed.
Pulagi ya ScrollSpy ndi yongosintha zokha za nav kutengera malo opukutira.
Tsitsani fayiloMpukutu m'munsimu ndi kuona navigation update. Zinthu zotsikirapo zidzawonetsedwanso. Yesani!
Ad leggings keytar, brunch id art party dolor labore. Pitchfork yr enim lo-fi asanagulitse. Ufulu wa njinga zamtundu wa Tumblr zilizonse. Ma cardigan opangidwa ndi manja. Chithunzi cha Velit seitan mcsweeney 3 wolf moon irure. Kabudula wa Cosby lomo wa jean, williamsburg hoodie minim qui mwina simunamvepo za iwo et cardigan trust fund culpa biodiesel wes anderson aesthetic. Nihil tattooed accusamus, cred irony biodiesel keffiyeh artisan ullamco consequat.
Veniam marfa masharubu skateboard, adipisicing fugiat velit pitchfork ndevu. Freegan ndevu aliqua cupidatat mcsweeney's vero. Cupidatat zinayi loko nisi, ea helvetica nulla carles. Tattooed cosby sweater food truck, mcsweeney's quis non freegan vinyl. Lo-fi wes anderson +1 sartorial. Carles non aesthetic exercitation quis gentrify. Brooklyn adipisicing craft beer vice keytar deserunt.
Occaecat commodo aliqua deelectus. Fap craft beer 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 ndi adipisicing. Consectetur nisi DIY minim messenger bag. Cred ex in, sustainable 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 messenger bag marfa whatever delectus food truck. Sapiente synth id guessnda. Locavore sed helvetica cliche irony, mabingu mwina simunawamvepo consequat hoodie gluten-free lo-fi fap aliquip. Labore elit placeat asanagulitse, terry richardson proident brunch nesciunt quis cosby sweater pariatur keffiyeh ut helvetica artisan. Cardigan craft mowa seitan readymade velit. VHS chambray laboris tempor veniam. Anim mollit minim commodo ullamco mabingu.
Imbani scrollspy kudzera pa javascript:
- $ ( '#navbar' ). scrollspy ()
Kuti muwonjezeko machitidwe a scrollspy pakuyenda kwanu kwapamwamba, ingowonjezerani data-spy="scroll"
chinthu chomwe mukufuna kuti mukazonde (nthawi zambiri ili lingakhale thupi).
- <body data-spy = "scroll" > ... </body>
<a href="#home">home</a>
kuyenera kufanana ndi chinthu chomwe chili mu dome ngati
<div id="home"></div>
.
Mukamagwiritsa ntchito scrollspy molumikizana ndi kuwonjezera kapena kuchotsa zinthu mu DOM, muyenera kuyimbira njira yotsitsimutsa motere:
- $ ( '[data-spy="scroll"]' ). chilichonse ( ntchito () {
- var $ kazitape = $ ( izi ). scrollspy ( 'refresh' )
- });
Dzina | mtundu | kusakhulupirika | kufotokoza |
---|---|---|---|
kuchepetsa | nambala | 10 | Ma pixel oti muyike kuchokera pamwamba powerengera malo osindikizira. |
Chochitika | Kufotokozera |
---|---|
yambitsa | Chochitikachi chimayaka nthawi iliyonse chinthu chatsopano chikatsegulidwa ndi scrollspy. |
Pulagi iyi imawonjezera tabu yachangu, yosinthika komanso magwiridwe antchito apiritsi kuti asinthe kudzera m'malo am'deralo.
Tsitsani fayiloDinani ma tabu omwe ali m'munsimu kuti musinthe pakati pa zobisika, ngakhale kudzera pazotsitsa.
denim yaiwisi mwina simunamvepo za iwo akabudula a jean Austin. Nesciunt tofu stumptown aliqua, retro synth master cleanse. Mustache cliche tempor, williamsburg carles vegan helvetica. Reprehenderit butcher retro keffiyeh dreamcatcher synth. Cosby sweater eu banh mi, qui irure terry richardson ex squid. Aliquip placeat salvia cillum iphone. Seitan aliquip quis cardigan American aarel, 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 asanagulitse master cleanse gluten-free squid scenester freegan cosby sweater. Fanny pack portland seitan DIY, art locavore wolf cliche high life echo park Austin. Cred vinyl keffiyeh DIY salvia PBR, banh mi asanagulitse famu-to-table VHS viral locavore cosby sweater. Lomo wolf viral, masharubu okonzeka kupanga mabingu keffiyeh craft beer marfa ethical. Wolf salvia freegan, sartorial keffiyeh echo park vegan.
Yambitsani ma tabbles kudzera pa javascript (tabu iliyonse iyenera kutsegulidwa payekhapayekha):
- $ ( '#myTab a' ). dinani ( ntchito ( e ) {
- e . preventDefault ();
- $ ( izi ). tabu ( 'show' );
- })
Mutha kuyambitsa ma tabo amodzi m'njira zingapo:
- $ ( '#myTab a[href="#profile"]' ). tabu ( 'show' ); // Sankhani tabu ndi dzina
- $ ( '#myTab a:first' ). tabu ( 'show' ); // Sankhani tsamba loyamba
- $ ( '#myTab a:last' ). tabu ( 'show' ); // Sankhani tabu yomaliza
- $ ( '#myTab li:eq(2) a' ). tabu ( 'show' ); // Sankhani tabu lachitatu (0-indexed)
Mutha kuyambitsa tabu kapena kuyenda kwa mapiritsi osalemba javascript mwa kungotchulapo data-toggle="tab"
kapena data-toggle="pill"
pa chinthu. Kuwonjezera nav
ndi nav-tabs
makalasi pa tabu ul
idzagwiritsa ntchito kalembedwe ka bootstrap tabu.
- <ul class = "nav-tabs" >
- <li><a href = "#home" data-toggle = "tab"> Kwawo </a></li >
- <li><a href = "#profile" data-toggle = "tab"> Mbiri </a></li >
- <li><a href = "#messages" data-toggle = "tab"> Mauthenga </a></li >
- <li><a href = "#settings" data-toggle = "tab"> Zokonda </a> </li >
- </ul>
Imayatsa chinthu cha tabu ndi chidebe cha zinthu. Tabu iyenera kukhala ndi imodzi data-target
kapena href
yolunjika ku chidebe mu DOM.
- <ul class = "nav nav-tabs" id = "myTab" >
- <li class = "active" > <a href = "#home"> Kwawo </a></li>
- <li><a href = "#profile"> Mbiri </a> </li>
- <li><a href = "#mauthenga"> Mauthenga </a> </li>
- <li><a href = "#zikhazikiko"> Zokonda </a> </li>
- </ul>
- <div class = "tab-content" >
- <div class = "tab-pane active" id = "home" > ... </div>
- <div class = "tab-pane" id = "mbiri" > ... </div>
- <div class = "tab-pane" id = "mauthenga" > ... </div>
- <div class = "tab-pane" id = "zikhazikiko" > ... </div>
- </div>
- <script>
- $ ( ntchito () {
- $ ( '#myTab a:last' ). tabu ( 'show' );
- })
- </script>
Chochitika | Kufotokozera |
---|---|
chiwonetsero | Chochitikachi chikuyaka pa tabu chiwonetsero, koma tabu yatsopano isanasonyezedwe. Gwiritsani ntchito event.target ndikuwongolera event.relatedTarget tabu yomwe ikugwira ntchito ndi tabu yogwira kale (ngati ilipo) motsatana. |
zowonetsedwa | Chochitika ichi chikuyaka pa tabu chiwonetsero pambuyo poti tabu yawonetsedwa. Gwiritsani ntchito event.target ndikuwongolera event.relatedTarget tabu yomwe ikugwira ntchito ndi tabu yogwira kale (ngati ilipo) motsatana. |
- $ ( 'a[data-toggle="tab"]' ). pa ( 'yawonetsedwa' , ntchito ( e ) {
- e . target // tabu yotsegulidwa
- e . zokhudzanaTarget // tabu yapita
- })
Kulimbikitsidwa ndi pulogalamu yowonjezera ya jQuery.tipsy yolembedwa ndi Jason Frame; Tooltips ndi mtundu wosinthidwa, womwe sudalira zithunzi, gwiritsani ntchito CSS3 pa makanema ojambula pamanja, ndi mawonekedwe a data posungira mitu yanu.
Tsitsani fayiloYendani pamwamba pa maulalo omwe ali pansipa kuti muwone zida zothandizira:
mathalauza olimba next level keffiyeh mwina simunamvepo. Photo booth ndevu za denim yaiwisi letterpress vegan messenger bag stumptown. Zovala za Farm-to-table seitan, mcsweeney's fixie sustainable quinoa 8-bit american zovala zili ndi terry richardson vinyl chambray. Ndevu stumptown, ma cardigans banh mi lomo mabingu. Tofu biodiesel williamsburg marfa, four loko mcsweeney's cleanse vegan chambray. A really artisan artisan whatever keytar , malo owoneka bwino a famu-to-table banksy Austin twitter handle freegan cred raw denim single-origin coffee viral.
Yambitsani chida kudzera pa javascript:
- $ ( '#chitsanzo' ). chida ( zosankha )
Dzina | mtundu | kusakhulupirika | kufotokoza |
---|---|---|---|
makanema ojambula | boolean | zoona | gwiritsani ntchito kusintha kwa css ku chida |
kuika | chingwe | ntchito | 'pamwamba' | momwe mungakhazikitsire chida - pamwamba | pansi | kumanzere | kulondola |
wosankha | chingwe | zabodza | Ngati chosankha chaperekedwa, zida zopangira zida zidzaperekedwa ku zomwe zafotokozedwazo. |
mutu | chingwe | ntchito | '' | mtengo wamutu wokhazikika ngati tag ya `title` palibe |
choyambitsa | chingwe | 'pitani' | momwe chida chimayambira - hover | kuganizira | buku |
kuchedwa | nambala | chinthu | 0 | kuchedwa kusonyeza ndi kubisa chida (ms) - sikugwira ntchito pamanja choyambitsa mtundu Ngati nambala yaperekedwa, kuchedwetsa kumayikidwa pazithunzi zonse ziwiri Kapangidwe kachinthu ndi: |
Pazifukwa zogwirira ntchito, Tooltip ndi Popover data-apis alowa. Ngati mukufuna kuzigwiritsa ntchito ingotchulani kusankha.
- <a href = "#" rel = "tooltip" title = "chida choyamba"> yendani pamwamba panga </a>
Imangiriza chogwirizira ku zida zosonkhanitsira.
Imawulula zida za chinthu.
- $ ( '#element' ). chida ( 'show' )
Imabisa chida cha chinthu.
- $ ( '#element' ). chida ( 'hide' )
Imatembenuza chida cha chinthu.
- $ ( '#element' ). chida ( 'toggle' )
Onjezani zophatikizika zazing'ono, monga zomwe zili pa iPad, kuzinthu zilizonse zachidziwitso chachiwiri.
* Imafunikira Tooltip kuti iphatikizidwe
Tsitsani fayiloYendetsani pa batani kuti muyambitse popover.
Yambitsani popover kudzera pa javascript:
- $ ( '#chitsanzo' ). popover ( zosankha )
Dzina | mtundu | kusakhulupirika | kufotokoza |
---|---|---|---|
makanema ojambula | boolean | zoona | gwiritsani ntchito kusintha kwa css ku chida |
kuika | chingwe | ntchito | 'chabwino' | momwe mungayikitsire popover - pamwamba | pansi | kumanzere | kulondola |
wosankha | chingwe | zabodza | ngati chosankha chaperekedwa, zida zothandizira zidzaperekedwa ku zolinga zomwe zatchulidwa |
choyambitsa | chingwe | 'pitani' | momwe chida chimayambira - hover | kuganizira | buku |
mutu | chingwe | ntchito | '' | mtengo wamutu wokhazikika ngati mawonekedwe a `mutu` palibe |
zomwe zili | chingwe | ntchito | '' | mtengo wokhazikika ngati mawonekedwe a `data-contain` palibe |
kuchedwa | nambala | chinthu | 0 | kuchedwa kusonyeza ndi kubisa popover (ms) - sikugwira ntchito pamanja choyambitsa mtundu Ngati nambala yaperekedwa, kuchedwetsa kumayikidwa pazithunzi zonse ziwiri Kapangidwe kachinthu ndi: |
Pazifukwa zogwirira ntchito, Tooltip ndi Popover data-apis alowa. Ngati mukufuna kuzigwiritsa ntchito ingotchulani kusankha.
Imayambitsa ma popover pazosonkhanitsira zinthu.
Imawulula ma element popover.
- $ ( '#element' ). popover ( 'show' )
Imabisa zinthu zotuluka.
- $ ( '#element' ). popover ( 'bisala' )
Imatembenuza ma element popover.
- $ ( '#element' ). popover ( 'toggle' )
Pulagi yochenjeza ndi kagulu kakang'ono kowonjezera magwiridwe antchito ku zidziwitso.
TsitsaniPulogalamu yowonjezera yochenjeza imagwira ntchito pa mauthenga ochenjeza nthawi zonse, ndikuletsa mauthenga.
Sinthani ichi ndi icho ndikuyesanso. Ndife mollis, est non commodo luctus, nisi erat porttitor ligula, eget lacinia odio sem nec elit. Cras mattis consectetur purus sit amet fermentum.
Yambitsani kuchotsedwa kwa chenjezo kudzera pa javascript:
- $ ( ".chidziwitso" ). chenjezo ()
Ingowonjezerani data-dismiss="alert"
ku batani lanu lakutseka kuti mungopereka chidziwitso chapafupi.
- <a class = "close" data-dismiss = "alert" href = "#" > × </a>
Zimangiriza zidziwitso zonse ndi magwiridwe antchito apafupi. Kuti zidziwitso zanu ziwonetsedwe zikatsekedwa, onetsetsani kuti zili .fade
ndi .in
kalasi zomwe zagwiritsidwa ntchito kale.
Kutseka chenjezo.
- $ ( ".chidziwitso" ). chenjezo ( 'close' )
Gulu lachidziwitso la Bootstrap limawulula zochitika zingapo kuti zigwirizane ndi zochitika zochenjeza.
Chochitika | Kufotokozera |
---|---|
pafupi | Chochitika ichi chimayaka nthawi yomweyo close njira yachitsanzo itayitanidwa. |
chatsekedwa | Chochitikachi chimachotsedwa pamene chenjezo latsekedwa (lidikirira kuti kusintha kwa css kumalize). |
- $ ( '#chenjezo langa' ). kumanga ( 'kotsekedwa' , ntchito () {
- // kuchitapo kanthu...
- })
Pezani masitayelo oyambira ndi chithandizo chosinthika cha zinthu zomwe zimatha kugwa monga ma accordion ndi navigation.
Tsitsani fayilo* Imafunikira pulogalamu yowonjezera ya Transitions kuti iphatikizidwe.
Pogwiritsa ntchito pulogalamu yowonjezera ya kugwa, tinapanga widget yosavuta ya accordion:
Yambitsani kudzera pa javascript:
- $ ( ".kugwa" ). kugwa ()
Dzina | mtundu | kusakhulupirika | kufotokoza |
---|---|---|---|
kholo | wosankha | zabodza | Ngati chosankha ndiye kuti zinthu zonse zomwe zimasokonekera pansi pa kholo lotchulidwa zidzatsekedwa chinthu chosokonekerachi chikuwonetsedwa. (zofanana ndi chikhalidwe cha accordion) |
kusintha | boolean | zoona | Imasintha chinthu chomwe chimasokonekera pakuyitanitsa |
Ingowonjezerani data-toggle="collapse"
ndi data-target
chinthu kuti muzitha kuwongolera chinthu chomwe chimatha kutha. Malingaliro data-target
amavomereza chosankha cha css kuti agwiritse ntchito kugwa. Onetsetsani kuti mwawonjezera kalasi collapse
ku chinthu chomwe chimatha. Ngati mukufuna kuti isatseguke, onjezani kalasi yowonjezera in
.
- <button class = "btn btn-danger" data-toggle = "collapse" data-target = "#demo" >
- zosavuta kukomoka
- </ batani>
- <div id = "demo" class = "kugwera mkati" > … </div>
data-parent="#selector"
. Onani pachiwonetsero kuti muwone izi zikugwira ntchito.
Imatsegula zomwe zili patsamba lanu ngati chinthu chosokonekera. Imavomereza zomwe mungachite object
.
- $ ( '#myCollapsible' ). kugwa ({
- toggle : zabodza
- })
Imasintha zinthu zomwe zimagundika kuti ziwonetsedwe kapena zobisika.
Imawonetsa chinthu chomwe chimatha kutha.
Imabisa chinthu chomwe chimatha kutha.
Gulu la kugwa la Bootstrap limawulula zochitika zingapo kuti zigwirizane ndi kugwa.
Chochitika | Kufotokozera |
---|---|
chiwonetsero | Chochitika ichi chimayaka nthawi yomweyo show njira yachitsanzo itayitanidwa. |
zowonetsedwa | Chochitikachi chimachotsedwa pomwe chinthu chakugwa chawonetsedwa kwa wogwiritsa ntchito (chidikirira kuti kusintha kwa css kumalize). |
kubisa | Chochitikachi chimathamangitsidwa nthawi yomweyo hide njirayo itayitanidwa. |
zobisika | Chochitikachi chimachotsedwa pomwe chinthu chakugwa chabisidwa kwa wogwiritsa ntchito (chidikirira kuti kusintha kwa css kumalize). |
- $ ( '#myCollapsible' ). pa ( 'zobisika' , ntchito () {
- // kuchitapo kanthu...
- })
Pulogalamu yowonjezera yowonjezera yoyendetsa njinga kudzera muzinthu. Kuyenda mosangalatsa.
Tsitsani fayiloOnerani chiwonetsero chazithunzi pansipa.
Imbani kudzera pa javascript:
- $ ( '.carousel' ). carousel ()
Dzina | mtundu | kusakhulupirika | kufotokoza |
---|---|---|---|
nthawi | nambala | 5000 | Kuchuluka kwa nthawi yochedwetsa pakati pa kuyendetsa chinthu chokha. Ngati zabodza, carousel siizungulira yokha. |
kupuma | chingwe | "kuyenda" | Imayimitsa njinga ya carousel pa mouseenter ndikuyambanso kukwera njinga ya carousel pa mouseleave. |
Mawonekedwe a data amagwiritsidwa ntchito pazowongolera zam'mbuyomu ndi zina. Onani chitsanzo pansipa.
- <div id = "myCarousel" class = "carousel slide" >
- <!-- Zinthu za Carousel -->
- <div class = "carousel-inner" >
- <div class = "chinthu chogwira" > ... </div>
- <div class = "chinthu" > ... </div>
- <div class = "chinthu" > ... </div>
- </div>
- <!-- Carousel nav -->
- <a class = "carousel-control left" href = "#myCarousel" data-slide = "prev"> & lsaquo ; </a>
- <a class = "carousel-control right" href = "#myCarousel" data-slide = "next" > › </a>
- </div>
Imayambitsa carousel ndi zosankha zomwe mungasankhe object
ndikuyamba kuyendetsa zinthu.
- $ ( '.carousel' ). carousel ({
- nthawi : 2000
- })
Amazungulira zinthu za carousel kuchokera kumanzere kupita kumanja.
Imayimitsa carousel kuti isayendetse zinthu.
Azunguliza carousel ku chimango china (0 kutengera, ofanana ndi gulu).
Kuzungulira kwa chinthu cham'mbuyo.
Kuzungulira ku chinthu chotsatira.
Kalasi ya carousel ya Bootstrap imawulula zochitika ziwiri zolumikizana ndi machitidwe a carousel.
Chochitika | Kufotokozera |
---|---|
yenda | Chochitika ichi chimayaka nthawi yomweyo slide njira yachitsanzo ikugwiritsidwa ntchito. |
slid | Chochitikachi chimachotsedwa pamene carousel yamaliza kusintha kwake. |
Pulagi yoyambira, yotalikira mosavuta yopangira mwachangu zilembo zokongola ndi mawu amtundu uliwonse.
Tsitsani fayiloYambani kulemba m'gawo lomwe lili pansipa kuti muwonetse zotsatira za typeahead.
Imbani typeahead kudzera javascript:
- $ ( '.typeahead' ). mtundu ()
Dzina | mtundu | kusakhulupirika | kufotokoza |
---|---|---|---|
gwero | gulu | [] | Gwero la data loti mufunse motsutsa. |
zinthu | nambala | 8 | Nambala yochulukitsitsa yazinthu zomwe zikuwonetsedwa pazotsitsa. |
wofananira | ntchito | osamva kanthu | Njira yomwe imagwiritsidwa ntchito kudziwa ngati funso likugwirizana ndi chinthu. Amavomereza mkangano umodzi, item womwe ungayesere funso. Pezani funso lapano ndi this.query . Bweretsani boolean true ngati funso likufanana. |
sintha | ntchito | zofananira ndendende, kukhudzidwa kwa nkhani, kusakhudzidwa ndi vuto |
Njira yomwe imagwiritsidwa ntchito posankha zotsatira zomaliza zokha. Imavomereza mkangano umodzi items ndipo imakhala ndi gawo la chitsanzo cha typeahead. Lowetsani funso lomwe lilipo ndi this.query . |
chowunikira | ntchito | ikuwonetsa mafananidwe onse osasinthika | Njira yomwe imagwiritsidwa ntchito powunikira zotsatira zomaliza zokha. Imavomereza mkangano umodzi item ndipo imakhala ndi gawo la chitsanzo cha typeahead. Iyenera kubwereranso html. |
Onjezani mawonekedwe a data kuti mulembetse chinthu chokhala ndi typeahead.
- <input type = "text" data- provide = "typeahead" >
Imayambitsa zolowetsa ndi typeahead.