Zana ibice bya Bootstrap mubuzima-ubungubu hamwe na plugin 12 yihariye ya jQuery .
Byoroheje, ariko byoroshye, fata kuri gakondo ya javascript modal plugin hamwe nibikorwa byibuze bisabwa nibikorwa bisanzwe.
Ongeraho ibimanuka hafi ya byose muri Bootstrap hamwe niyi plugin yoroshye. Bootstrap iranga menu yuzuye yamanutse kuri navbar, tabs, nibinini.
Koresha umuzingo kugirango uhite uvugurura amahuza muri navbar yawe kugirango werekane ihuriro rikora rishingiye kumwanya wizingo.
Koresha iyi plugin kugirango ukore tabs hamwe nibinini byingirakamaro mubemerera guhinduranya binyuze mumeza yibirimo.
Gufata ibintu bishya kuri jQuery Tipsy plugin, Tooltips ntabwo yishingikiriza kumashusho-bakoresha CSS3 kuri animasiyo na data-ibiranga kubika izina ryibanze.
Ongeraho uduce duto twibirimo, nkibiri kuri iPad, kubintu byose byo guturamo amakuru yisumbuye.
* Irasaba ibikoresho byashyizwemo
Amacomeka yo kumenyesha nicyiciro gito cyo kongeramo imikorere yegeranye.
Kora byinshi hamwe na buto. Kugenzura buto ivuga cyangwa gukora amatsinda ya buto kubindi bikoresho nkibikoresho.
Shakisha uburyo bwibanze nubufasha bworoshye kubintu bishobora gusenyuka nka bordion hamwe nogukora.
Kora umunezero-wo-kuzenguruka ibintu byose wifuza gutanga interineti yerekana ibiyirimo.
A shingiro, byoroshye kwagura plugin yo gukora byihuse gukora imashini yimyandikire hamwe nuburyo ubwo aribwo bwose bwanditse.
Kubintu byoroshye byinzibacyuho, shyiramo bootstrap-inzibacyuho.js rimwe kunyerera muburyo cyangwa kuzimangana.
* Birakenewe kuri animasiyo mumacomeka
Byoroheje, ariko byoroshye, fata kuri gakondo ya javascript modal plugin hamwe nibikorwa byibuze bisabwa nibikorwa bisanzwe.
Kuramo dosiyeHasi nuburyo bwahinduwe muburyo.
Umubiri umwe…
Hindura modal ukoresheje javascript ukanze buto hepfo. Bizanyerera kandi bishire hejuru yurupapuro.
Tangiza uburyo bwo kwerekanaHamagara modal ukoresheje javascript:
- $ ( '#myModal' ). modal ( amahitamo )
Izina | Ubwoko | Mburabuzi | ibisobanuro |
---|---|---|---|
Inyuma | boolean | ni ukuri | Harimo modal-backdrop element. Ubundi, vuga static kuri backdrop idafunga modal kanda. |
Mwandikisho | boolean | ni ukuri | Gufunga modal mugihe urufunguzo rwo guhunga rukanda |
kwerekana | boolean | ni ukuri | Erekana modal mugihe yatangijwe. |
Urashobora gukora modal kurupapuro rwawe byoroshye utiriwe wandika umurongo umwe wa javascript. Gusa shyira data-toggle="modal"
kubintu bigenzura hamwe na a data-target="#foo"
cyangwa href="#foo"
bihuye na modal element id, kandi iyo ukanze, bizatangiza modal yawe.
Na none, kugirango wongere amahitamo kurugero rwawe, gusa ubishyiremo nkibintu byongeweho biranga ibintu haba kugenzura ibintu cyangwa modal ubwayo.
- <a class = "btn" data-toggle = "modal" href = "#myModal"> Gutangiza Moderi </a>
- <div class = "modal guhisha" id = "myModal" >
- <div class = "modal-umutwe" >
- <buto ubwoko = "buto" urwego = "gufunga" data-gusezerera = "modal" > × </button>
- <h3> Umutwe wuburyo </h3>
- </div>
- <div class = "modal-umubiri" >
- <p> Umubiri umwe mwiza… </p>
- </div>
- <div class = "modal-footer" >
- <a href = "#" class = "btn" data-dismiss = "modal"> Funga </a> _
- <a href = "#" class = "btn btn-primary"> Bika impinduka </a>
- </div>
- </div>
.fade
kubintu
.modal
(reba kuri demo kugirango ubone ibi mubikorwa) hanyuma ushiremo bootstrap-inzibacyuho.js.
Koresha ibikubiyemo nkibisanzwe. Emera amahitamo object
.
- $ ( '#myModal' ). modal ({
- Mwandikisho : ibinyoma
- })
Intoki ihinduranya modal.
- $ ( '#myModal' ). modal ( 'guhinduranya' )
Nintoki ifungura modal.
- $ ( '#myModal' ). modal ( 'kwerekana' )
Nintoki ihishe modal.
- $ ( '#myModal' ). modal ( 'guhisha' )
Icyiciro cya Bootstrap cyerekana ibyabaye bike kugirango bifatanye mubikorwa.
Icyabaye | Ibisobanuro |
---|---|
kwerekana | Ibirori birasa ako kanya mugihe show urugero rwitwa. |
yerekanwe | Ibirori birukanwa mugihe modal yakozwe igaragara kubakoresha (izategereza ko css inzibacyuho zirangira). |
kwihisha | Ibi birori birahita bisohoka mugihe uburyo hide bwurugero bwahamagawe. |
byihishe | Ibirori birukanwa mugihe modal yarangije guhishwa kumukoresha (izategereza ko css inzibacyuho zirangira). |
- $ ( '#myModal' ). kuri ( 'bihishe' , imikorere () {
- // Gira icyo ukora…
- })
Ongeraho ibimanuka hafi ya byose muri Bootstrap hamwe niyi plugin yoroshye. Bootstrap iranga menu yuzuye yamanutse kuri navbar, tabs, nibinini.
Kuramo dosiyeKanda ahamanuka nav ihuza muri navbar n'ibinini hepfo kugirango ugerageze ibitonyanga.
Hamagara ibitonyanga ukoresheje javascript:
- $ ( '.dropdown-toggle' ). kumanuka ()
Kugirango wongere byihuse imikorere yibintu byose wongereho data-toggle="dropdown"
kandi bootstrap yemewe yose izahita ikora.
data-target="#fat"
cyangwa
href="#fat"
.
- <ul class = "nav nav-ibinini" >
- <li urwego = "rukora" > <a href = "#"> Ihuza risanzwe </a> </li>
- <li urwego = "guta" id = "menu1" >
- <a class = "dropdown-toggle" data-toggle = "dropdown" href = "#menu1"> _
- Kumanuka
- <b urwego = "caret" > </b>
- </a>
- <ul class = "ibitonyanga-menu" >
- <li> <a href = "#"> Igikorwa </a> </li>
- <li> <a href = "#"> Ikindi gikorwa </a> </li>
- <li> <a href = "#"> Ikindi kintu hano </a> </li>
- <li urwego = "umutandukanya" > </li>
- <li> <a href = "#"> Ihuza ritandukanye </a> </li>
- </ul>
- </li>
- ...
- </ul>
Kugirango URL igumane, koresha data-target
ikiranga aho href="#"
.
- <ul class = "nav nav-ibinini" >
- <li urwego = "kumanuka" >
- <a class = "dropdown-toggle" data-toggle = "dropdown" data-target = "#" href = "path/to/page.html"> _
- Kumanuka
- <b urwego = "caret" > </b>
- </a>
- <ul class = "ibitonyanga-menu" >
- ...
- </ul>
- </li>
- </ul>
Porogaramu api yo gukora menus kumurongo watanzwe cyangwa kugendagenda.
Gucomeka kwa ScrollSpy nuguhita uvugurura intego za nav ukurikije umwanya wizingo.
Kuramo dosiyeKuzenguruka aha hepfo hanyuma urebe ibishya bigenda. Ibitonyanga byamanuka bizagaragazwa kandi. Gerageza!
Ad leggings keytar, brunch id art ibirori dolor labore. Pitchfork yr enim lo-fi mbere yuko bagurisha qui. Tumblr umurima-kumeza uburenganzira bwamagare ibyo aribyo byose. Anim keffiyeh carles cardigan. Velit seitan mcsweeney ifoto yicyumba 3 impyisi ukwezi irure. Cosby swater lomo jean ikabutura, williamsburg hoodie minim qui ushobora kuba utarigeze ubyumva et cardigan kwizera ikigega culpa biodiesel wes anderson aesthetic. Nihil tattooed accusamus, inguzanyo irony biodiesel keffiyeh artisan ullamco ingaruka.
Veniam marfa ubwanwa bwa skateboard, adipisising fugiat velit pitchfork ubwanwa. Freegan ubwanwa aliqua cupidatat mcsweeney's vero. Cupidatat bane loko nisi, ea helvetica nulla carles. Tattooed cosby swater ikamyo y'ibiryo, mcsweeney's quis non freegan vinyl. Lo-fi wes anderson +1 sartorial. Carles imyitozo idahwitse quis gentrify. Brooklyn adipisising ubukorikori byeri vice keytar deserunt.
Occaecat commodo aliqua delectus. Fap craft inzoga deserunt skateboard ea. Lomo uburenganzira bwamagare adipisising banh mi, velit ea sunt urwego rukurikira locavore ikawa imwe ikomoka muri magna veniam. Ubuzima burebure id vinyl, echo parike ibisubizo quis aliquip banh mi pitchfork. Vero VHS est adipisising. Consectetur nisi DIY minim messenger umufuka. Cred ex in, irambye delectus consectetur fanny pack iphone.
In incididunt echo park, officia deserunt mcsweeney's proident master cleanse thundercats sapiente veniam. Excepteur VHS elit, proident shoreditch +1 biodiesel laborum craft beer. Single-origin coffee wayfarers irure four loko, cupidatat terry richardson master cleanse. Assumenda you probably haven't heard of them art party fanny pack, tattooed nulla cardigan tempor ad. Proident wolf nesciunt sartorial keffiyeh eu banh mi sustainable. Elit wolf voluptate, lo-fi ea portland before they sold out four loko. Locavore enim nostrud mlkshk brooklyn nesciunt.
Ad leggings keytar, brunch id art party dolor labore. Pitchfork yr enim lo-fi before they sold out qui. Tumblr farm-to-table bicycle rights whatever. Anim keffiyeh carles cardigan. Velit seitan mcsweeney's photo booth 3 wolf moon irure. Cosby sweater lomo jean shorts, williamsburg hoodie minim qui you probably haven't heard of them et cardigan trust fund culpa biodiesel wes anderson aesthetic. Nihil tattooed accusamus, cred irony biodiesel keffiyeh artisan ullamco consequat.
Keytar twee blog, culpa messenger umufuka marfa icyaricyo cyose cya delectus ikamyo. Sapiente synth id assnda. Lokavore sed helvetica cliche irony, inkuba ushobora kuba utarigeze uyumva ingaruka za hoodie gluten-yubusa lo-fi fap aliquip. Umurimo elit umwanya mbere yuko bagurisha, terry richardson proident brunch nesciunt quis cosby swater pariatur keffiyeh ut helvetica umunyabukorikori. Cardigan craft byeri seitan yiteguye gukora velit. VHS chambray laboris by'agateganyo veniam. Anim mollit minim commodo ullamco inkuba.
Hamagara umuzingo ukoresheje javascript:
- $ ( '#navbar' ). umuzingo ()
Kugirango byoroshye kongeramo imyitwarire ya scrollspy kumurongo wawe wo hejuru, gusa ongeraho data-spy="scroll"
kubintu ushaka kuneka (mubisanzwe iyi yaba umubiri).
- < amakuru yumubiri-maneko = "umuzingo" > ... </body>
<a href="#home">home</a>
ugomba guhuza ikintu muri dom nka
<div id="home"></div>
.
Mugihe ukoresheje umuzingo ufatanije no kongera cyangwa gukuraho ibintu muri DOM, uzakenera guhamagara uburyo bushya nka gutya:
- $ ( '[data-maneko = "umuzingo"]' ). buri ( imikorere () {
- var $ maneko = $ ( iyi ). umuzingo ( 'kugarura' )
- });
Izina | Ubwoko | Mburabuzi | ibisobanuro |
---|---|---|---|
offset | umubare | 10 | Pixels kugirango uve hejuru iyo ubaze umwanya wumuzingo. |
Icyabaye | Ibisobanuro |
---|---|
gukora | Ibirori birashya igihe cyose ikintu gishya gihinduwe na muzingo. |
Gucomeka kongeramo byihuse, imbaraga za tab hamwe nibinini bikora kugirango bihindurwe mubirimo byaho.
Kuramo dosiyeKanda ahanditse hepfo kugirango uhindure hagati yihishe, ndetse unyuze kumurongo.
Raw denim ushobora kuba utarigeze wumva ibya jean ikabutura Austin. Nesciunt tofu stumptown aliqua, retro synth master suku. Mustache cliche tempor, williamsburg carles vegan helvetica. Reprehenderit butcher retro keffiyeh inzozi zo gufata. Cosby swater eu banh mi, qui irure terry richardson ex squid. Aliquip umwanya wa saliviya cillum iphone. Seitan aliquip quis cardigan imyambaro yabanyamerika, 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.
Ikigega cyizere seitan inyuguti, keytar mbisi denim keffiyeh etsy art ibirori mbere yuko bagurisha master cleanse gluten-free squid scenester freegan cosby swater. Fanny pack portland seitan DIY, ibirori byubuhanzi locavore impyisi cliche ubuzima burebure echo park Austin. Cred vinyl keffiyeh DIY salvia PBR, banh mi mbere yuko bagurisha umurima-kumeza VHS virusi ya locavore cosby swater. Lomo impyisi virusi, ubwanwa bwiteguye inkuba keffiyeh ubukorikori byeri marfa imyitwarire. Impyisi saliviya freegan, sartorial keffiyeh echo park vegan.
Gushoboza tabbable ukoresheje javascript (buri tab igomba gukenera kugiti cye):
- $ ( '#myTab a' ). kanda ( imikorere ( e ) {
- e . gukumiraIbisanzwe ();
- $ ( iyi ). tab ( 'kwerekana' );
- })
Urashobora gukora ama tabs kugiti cye muburyo butandukanye:
- $ ( '#myTab a [href = "# umwirondoro"]' ). tab ( 'kwerekana' ); // Hitamo tab ukoresheje izina
- $ ( '#myTab a: ubanza' ). tab ( 'kwerekana' ); // Hitamo tab ya mbere
- $ ( '#myTab a: iheruka' ). tab ( 'kwerekana' ); // Hitamo tab ya nyuma
- $ ( '#myTab li: eq (2) a' ). tab ( 'kwerekana' ); // Hitamo tab ya gatatu (0-yerekana)
Urashobora gukora tab cyangwa ibinini bigenda utanditse javascript iyo ari yo yose ugaragaza gusa data-toggle="tab"
cyangwa data-toggle="pill"
kubintu. Ongeraho i nav
hamwe nav-tabs
namasomo kuri tab ul
bizakoresha bootstrap tab styling.
- <ul class = "nav nav-tabs" >
- <li> <a href = "#home" data-toggle = "tab"> Urugo </a> </li>
- <li> <a href = "#profile" data-toggle = "tab"> Umwirondoro </a> </li>
- <li> <a href = "#messages" data-toggle = "tab"> Ubutumwa </a> </li>
- <li> <a href = "#settings" data-toggle = "tab"> Igenamiterere </a> </li>
- </ul>
Gukora tab element hamwe nibikoresho birimo. Tab igomba kuba ifite a data-target
cyangwa href
igamije icyerekezo cya kontineri muri DOM.
- <ul class = "nav nav-tabs" id = "myTab" >
- <li urwego = "rukora" > <a href = "#urugo"> Urugo </a> </li>
- <li> <a href = "#profile"> Umwirondoro </a> </li>
- <li> <a href = "#messages"> Ubutumwa </a> </li>
- <li> <a href = "#settings"> Igenamiterere </a> </li>
- </ul>
- <div class = "tab-ibirimo" >
- <div class = "tab-pane ikora" id = "urugo" > ... </div>
- <div class = "tab-pane" id = "umwirondoro" > ... </div>
- <div class = "tab-pane" id = "ubutumwa" > ... </div>
- <div class = "tab-pane" id = "igenamiterere" > ... </div>
- </div>
- <Inyandiko
- $ ( imikorere () {
- $ ( '#myTab a: iheruka' ). tab ( 'kwerekana' );
- })
- </script>
Icyabaye | Ibisobanuro |
---|---|
kwerekana | Ibirori birasa kuri tab yerekana, ariko mbere yuko tab nshya yerekanwe. Koresha event.target no event.relatedTarget gutondekanya tab ikora hamwe na tab yabanjirije gukora (niba ihari). |
yerekanwe | Ibirori birasa kuri tab yerekanwe nyuma ya tab yerekanwe. Koresha event.target no event.relatedTarget gutondekanya tab ikora hamwe na tab yabanjirije gukora (niba ihari). |
- $ ( 'a [data-toggle = "tab"]' ). kuri ( 'yerekanwe' , imikorere ( e ) {
- e . intego // tab ikora
- e . bifitanye isano Intego // tab ibanza
- })
Ahumekewe na jQuery nziza cyane.ipipsy plugin yanditswe na Jason Frame; Ibikoresho ni verisiyo ivuguruye, idashingiye ku mashusho, koresha css3 kuri animasiyo, hamwe namakuru-ibiranga kubikwa umutwe waho.
Kuramo dosiyeHisha hejuru yibi bikurikira kugirango urebe ibikoresho:
Ipantaro ifatanye urwego rukurikira keffiyeh birashoboka ko utigeze ubyumva. Ifoto icyumba cyogosha ubwanwa mbisi denim inyuguti ya vegan messenger umufuka stumptown. Umurima-kumeza seitan, mcsweeney's fixie irambye quinoa 8-biti byabanyamerika bafite terry richardson vinyl chambray. Ubwanwa bwatsitaye, abakarigani banh mi lomo inkuba. Tofu biodiesel williamsburg marfa, bane loko mcsweeney yoza vegan chambray. Umunyabukorikori rwose birasekeje icyaricyo cyose keytar , scenester umurima-kumeza banki bankin Austin twitter ikora freegan inguzanyo mbisi denim inkomoko yikawa ya virusi.
Koresha ibikoresho ukoresheje javascript:
- $ ( '#Urugero' ). ibikoresho ( amahitamo )
Izina | Ubwoko | Mburabuzi | ibisobanuro |
---|---|---|---|
animasiyo | boolean | ni ukuri | Koresha css fade inzibacyuho kubikoresho |
gushyira | umugozi | imikorere | 'hejuru' | uburyo bwo gushyira ibikoresho - hejuru | munsi | ibumoso | iburyo |
uwatoranije | umugozi | ibinyoma | Niba uwatoranije atanzwe, ibikoresho byibikoresho bizahabwa intego zerekanwe. |
Umutwe | umugozi | imikorere | '' | agaciro ka titre agaciro niba `titre` tag idahari |
imbarutso | umugozi | 'hover' | burya ibikoresho byifashishwa - hover | kwibanda | imfashanyigisho |
gutinda | umubare | ikintu | 0 | gutinda kwerekana no guhisha ibikoresho (ms) - ntabwo bikoreshwa muburyo bwintoki Niba umubare watanzwe, gutinda gukoreshwa byombi guhisha / kwerekana Imiterere yibintu ni: |
Kubwimpamvu zimikorere, Tooltip na Popover data-apis irahitamo. Niba ushaka kubikoresha gusa garagaza amahitamo.
- <a href = "#" rel = "tooltip" title = "ibikoresho bya mbere"> unyereke hejuru yanjye </a>
Ongeraho ibikoresho byifashishwa mugukusanya ibintu.
Yerekana igikoresho cyibikoresho.
- $ ( '#element' ). ibikoresho ( 'kwerekana' )
Hisha igikoresho cyibikoresho.
- $ ( '#element' ). ibikoresho ( 'guhisha' )
Kuzuza ibikoresho by'ibikoresho.
- $ ( '#element' ). ibikoresho ( 'toggle' )
Ongeraho uduce duto twibirimo, nkibiri kuri iPad, kubintu byose byo guturamo amakuru yisumbuye.
* Irasaba Tooltip gushyirwamo
Kuramo dosiyeHisha hejuru ya buto kugirango utere popover.
Gushoboza popovers ukoresheje javascript:
- $ ( '#Urugero' ). popover ( amahitamo )
Izina | Ubwoko | Mburabuzi | ibisobanuro |
---|---|---|---|
animasiyo | boolean | ni ukuri | Koresha css fade inzibacyuho kubikoresho |
gushyira | umugozi | imikorere | 'iburyo' | uburyo bwo gushyira popover - hejuru | munsi | ibumoso | iburyo |
uwatoranije | umugozi | ibinyoma | niba uwatoranije yatanzwe, ibikoresho byibikoresho bizahabwa intego zerekanwe |
imbarutso | umugozi | 'hover' | burya ibikoresho byifashishwa - hover | kwibanda | imfashanyigisho |
Umutwe | umugozi | imikorere | '' | Mburabuzi Umutwe Agaciro niba `titre` ikiranga idahari |
ibirimo | umugozi | imikorere | '' | agaciro gasanzwe agaciro niba `data-ibirimo` ikiranga kidahari |
gutinda | umubare | ikintu | 0 | gutinda kwerekana no guhisha popover (ms) - ntabwo ikoreshwa muburyo bwintoki Niba umubare watanzwe, gutinda gukoreshwa byombi guhisha / kwerekana Imiterere yibintu ni: |
Kubwimpamvu zimikorere, Tooltip na Popover data-apis irahitamo. Niba ushaka kubikoresha gusa garagaza amahitamo.
Itangiza popovers yikintu cyo gukusanya.
Kugaragaza ibintu popover.
- $ ( '#element' ). popover ( 'kwerekana' )
Hisha ibintu popover.
- $ ( '#element' ). popover ( 'guhisha' )
Kuzuza ibintu popover.
- $ ( '#element' ). popover ( 'guhinduranya' )
Amacomeka yo kumenyesha nicyiciro gito cyo kongeramo imikorere yegeranye.
KuramoGucomeka plugin ikora kubutumwa busanzwe bwo kumenyesha, no guhagarika ubutumwa.
Hindura ibi n'ibi hanyuma ugerageze. Duis mollis, est non commodo luctus, nisi erat porttitor ligula, eget lacinia odio sem nec elit. Cras mattis consectetur purus yicara amet fermentum.
Emera kwirukana integuza ukoresheje javascript:
- $ ( ".alert" ). kuba maso ()
Gusa ongeraho data-dismiss="alert"
kuri bouton yawe yegeranye kugirango uhite utanga integuza yimikorere.
- <a class = "close" data-dismiss = "alert" href = "#"> & times ; </a>
Kuzuza integuza zose hamwe nibikorwa bya hafi. Kugira ngo imenyesha ryawe risohoke iyo rifunze, menya neza ko bafite icyiciro .fade
hamwe .in
nishuri ryabasabye.
Funga integuza.
- $ ( ".alert" ). kuba maso ( 'gufunga' )
Bootstrap yo kumenyesha ibyiciro byerekana ibintu bike byo guhuza ibikorwa.
Icyabaye | Ibisobanuro |
---|---|
hafi | Ibirori birasa ako kanya mugihe close urugero rwitwa. |
gufunga | Ibirori birukanwa mugihe integuza yafunzwe (izategereza ko css inzibacyuho zirangira). |
- $ ( '# my-alert' ). guhambira ( 'gufunga' , imikorere () {
- // Gira icyo ukora…
- })
Shakisha uburyo bwibanze nubufasha bworoshye kubintu bishobora gusenyuka nka bordion hamwe nogukora.
Kuramo dosiye* Irasaba plugin yinzibacyuho gushyirwamo.
Twifashishije plugin yo gusenyuka, twubatsemo widget yoroheje yuburyo bwa widget:
Gushoboza ukoresheje javascript:
- $ ( ".gusenyuka" ). gusenyuka ()
Izina | Ubwoko | Mburabuzi | ibisobanuro |
---|---|---|---|
umubyeyi | uwatoranije | ibinyoma | Niba uwatoranije noneho ibintu byose bishobora kugwa munsi yumubyeyi wabigenewe bizafungwa mugihe iki kintu gishobora kugwa. (bisa nimyitwarire ya gakondo) |
guhinduranya | boolean | ni ukuri | Kuzuza ibintu bishobora kugwa kuri invocation |
Gusa ongeraho data-toggle="collapse"
na a data-target
to element kugirango uhite ugenera kugenzura ibintu bishobora kugwa. Ikiranga data-target
cyemera css uwatoranije kugirango akoreshe gusenyuka kuri. Wemeze kongeramo urwego collapse
kubintu bishobora kugwa. Niba wifuza ko byafungura, ongeraho urwego rwinyongera in
.
- <buto icyiciro = "btn btn-akaga" data-toggle = "gusenyuka" data-intego = "#demo" >
- byoroshye gusenyuka
- </button>
- <div id = "demo" urwego = "gusenyuka muri" > … </div>
data-parent="#selector"
. Reba kuri demo kugirango ubone ibi mubikorwa.
Koresha ibikubiyemo nkibintu bishobora gusenyuka. Emera amahitamo object
.
- $ ( '#Collapsible' ). gusenyuka ({
- guhinduranya : ibinyoma
- })
Kuzuza ikintu gishobora kugwa kugirango cyerekanwe cyangwa cyihishe.
Erekana ikintu gishobora kugwa.
Hisha ikintu gishobora kugwa.
Bootstrap yo gusenyuka ibyiciro byerekana ibintu bike byo guhuza ibikorwa.
Icyabaye | Ibisobanuro |
---|---|
kwerekana | Ibirori birasa ako kanya mugihe show urugero rwitwa. |
yerekanwe | Ibirori birukanwa mugihe ikintu cyo gusenyuka cyakozwe kigaragara kubakoresha (bizategereza ko css inzibacyuho zirangira). |
kwihisha | Iki gikorwa kirahita gihita iyo hide uburyo bwahamagawe. |
byihishe | Ibirori birukanwa mugihe ikintu cyo gusenyuka cyihishe kumukoresha (uzategereza ko css inzibacyuho zirangira). |
- $ ( '#Collapsible' ). kuri ( 'bihishe' , imikorere () {
- // Gira icyo ukora…
- })
Reba igishushanyo gikurikira.
Hamagara ukoresheje javascript:
- $ ( '.carousel' ). karuseli ()
Izina | Ubwoko | Mburabuzi | ibisobanuro |
---|---|---|---|
intera | umubare | 5000 | Ingano yigihe cyo gutinda hagati yizunguruka yikintu. Niba ari ibinyoma, karuseli ntabwo izahita izunguruka. |
hagarara | umugozi | "hover" | Hagarika gusiganwa ku magare ya karuseli kuri mouseenter hanyuma ikomeza gusiganwa ku magare ya karuseli kuri mouseleave. |
Ibiranga data byakoreshejwe kubanza nubutaha. Reba urugero rwerekana hepfo.
- <div id = "myCarousel" urwego = " slide ya karuseli" >
- <! - Ibintu bya Carousel ->
- <div class = "karuseli-imbere" >
- <div class = "ikintu gikora" > … </div>
- <div class = "ikintu" > … </div>
- <div class = "ikintu" > … </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"> & rsaquo ; </a>
- </div>
Itangiza karuseli hamwe nuburyo bwo guhitamo object
hanyuma igatangira gusiganwa ku magare binyuze mubintu.
- $ ( '.carousel' ). karuseli ({
- intera : 2000
- })
Amagare anyuze muri karuseli kuva ibumoso ugana iburyo.
Hagarika karuseli gusiganwa ku magare binyuze mu bintu.
Kuzenguruka karuseli kumurongo runaka (0 ishingiye, isa na array).
Amagare ku kintu kibanziriza iki.
Amagare ku kintu gikurikira.
Bootstrap ya karuseli yerekana ibintu bibiri byo guhuza imikorere ya karuseli.
Icyabaye | Ibisobanuro |
---|---|
slide | Ibirori birasa ako kanya mugihe slide urugero rwakoreshejwe. |
kunyerera | Ibirori birukanwa mugihe karuseli yarangije kunyerera. |
A shingiro, byoroshye kwagura plugin yo gukora byihuse gukora imashini yimyandikire hamwe nuburyo ubwo aribwo bwose bwanditse.
Kuramo dosiyeTangira wandika mumurima hepfo kugirango werekane ibisubizo byanditse.
Hamagara typhahead ukoresheje javascript:
- $ ( '.ubwoko' ). Imyandikire ()
Izina | Ubwoko | Mburabuzi | ibisobanuro |
---|---|---|---|
isoko | array | [] | Inkomoko yamakuru yo kubaza. |
ibintu | umubare | 8 | Umubare ntarengwa wibintu byo kwerekana mumanuka. |
matcher | imikorere | urubanza rutumva | Uburyo bwakoreshejwe mukumenya niba ikibazo gihuye nikintu. Emera impaka imwe, item irwanya kugerageza ikibazo. Shikira ikibazo kiriho hamwe this.query . Subiza boolean true niba ikibazo gihuye. |
sorter | imikorere | bihuye neza, urubanza rworoshye, urubanza rutumva |
Uburyo bukoreshwa mugutondekanya ibisubizo byuzuye. Emera impaka imwe items kandi ifite intera ya typahead urugero. Reba ikibazo kiriho hamwe this.query . |
urumuri | imikorere | Kugaragaza Byose Bidasanzwe | Uburyo bukoreshwa mukugaragaza ibisubizo byuzuye. Emera impaka imwe item kandi ifite intera ya typahead urugero. Ugomba gusubira html. |
Ongeraho ibiranga amakuru kugirango wandike ikintu gifite imikorere ya typahead.
- <iyinjiza ubwoko = "inyandiko" data-gutanga = "typeahead" >
Itangiza icyinjijwe hamwe nimyandikire.