Zana ibice bya Bootstrap mubuzima-ubungubu hamwe na plugin 13 yihariye ya jQuery.
Amacomeka arashobora gushyirwamo kugiti cye (nubwo bamwe basabwa kwishingikiriza), cyangwa byose icyarimwe. Byombi bootstrap.js na bootstrap.min.js irimo amacomeka yose muri dosiye imwe.
Urashobora gukoresha amacomeka ya Bootstrap yose ukoresheje marike API utanditse umurongo umwe wa JavaScript. Nibikorwa bya mbere bya Bootstrap API kandi igomba kuba iyambere yawe mugihe ukoresheje plugin.
Ibyo byavuzwe, mubihe bimwe na bimwe birashobora kuba byiza kuzimya iyi mikorere. Kubwibyo, turatanga kandi ubushobozi bwo guhagarika amakuru yikiranga API muguhuza ibyabaye byose kumazina yumubiri yashyizwe hamwe na '' data-api'`. Ibi bisa nkibi:
- $ ( 'umubiri' ). kuzimya ( '.data-api' )
Ubundi, kugirango ugaragaze plugin yihariye, shyiramo gusa izina rya plugin nkumwanya wizina hamwe na data-api izina ryumwanya nkuyu:
- $ ( 'umubiri' ). kuzimya ( '.alert.data-api' )
Turizera kandi ko ugomba gushobora gukoresha amacomeka yose ya Bootstrap ukoresheje JavaScript API. API rusange rusange ni imwe, uburyo bukurikirana, kandi igasubiza icyegeranyo cyakozwe.
- $ ( ".btn.danger" ). buto ( "guhinduranya" ). OngerahoClass ( "ibinure" )
Uburyo bwose bugomba kwemera ibintu bidahitamo ikintu, umugozi ugamije uburyo runaka, cyangwa ntakintu (gitangiza plugin hamwe nimyitwarire idasanzwe):
- $ ( "#myModal" ). modal () // yatangijwe nibisanzwe
- $ ( "#myModal" ). modal ({ clavier : ibinyoma }) // yatangijwe nta clavier
- $ ( "#myModal" ). modal ( 'kwerekana' ) // itangiza kandi itabaza kwerekana ako kanya
Buri plugin irerekana kandi ibyubaka byayo ku mutungo wa `Constructor` : $.fn.popover.Constructor
. Niba ushaka kubona plugin runaka urugero, iyikure muburyo butaziguye : $('[rel=popover]').data('popover')
.
Rimwe na rimwe, birakenewe gukoresha amacomeka ya Bootstrap hamwe nibindi UI. Muri ibi bihe, umwanya wizina urashobora guhura rimwe na rimwe. Niba ibi bibaye, urashobora guhamagara .noConflict
kuri plugin wifuza guhindura agaciro ka.
- var bootstrapButton = $ . fn . buto . noConflict () // subiza $ .fn.ibuto kumurongo wagenwe mbere
- $ . fn . bootstrapBtn = bootstrapButton // tanga $ (). bootstrapBtn imikorere ya bootstrap
Bootstrap itanga ibintu byabigenewe kubikorwa byinshi bya plugin. Mubisanzwe, ibi biza muburyo butagira ingano kandi bwashize - aho infinitive (ex. show
) Itangizwa mugitangira ibirori, kandi ifishi yacyo ya kera (ex. shown
) Ni imbarutso yo kurangiza igikorwa.
Ibintu byose bitagira ingano bitanga gukumiraIbikorwa bisanzwe. Ibi bitanga ubushobozi bwo guhagarika ikorwa ryigikorwa mbere yuko gitangira.
- $ ( '#myModal' ). kuri ( 'kwerekana' , imikorere ( e ) {
- niba (! amakuru ) garuka e . gukumiraDefault () // ihagarika modal kwerekanwa
- })
Kubintu byoroshye byinzibacyuho, shyiramo bootstrap-inzibacyuho.js rimwe kuruhande rwizindi dosiye za JS. Niba ukoresha bootstrap.js yakozwe (cyangwa yagabanijwe) , nta mpamvu yo gushyiramo ibi-birahari.
Ingero nke za plugin yinzibacyuho:
Moderi iroroshe, ariko iroroshye, ikiganiro kibaza hamwe nibikorwa byibuze bisabwa nibikorwa byubwenge.
Byahinduwe modal hamwe numutwe, umubiri, hamwe nibikorwa byumutwe.
Umubiri umwe…
- <div class = "modal guhisha fade" >
- <div class = "modal-umutwe" >
- <buto ubwoko = "buto" urwego = "gufunga" data-gusezerera = "modal" aria-uhishe = "ukuri" > & ibihe; </button>
- <h3> Umutwe wuburyo </h3>
- </div>
- <div class = "modal-umubiri" >
- <p> Umubiri umwe mwiza… </p>
- </div>
- <div class = "modal-footer" >
- <a href = "#" class = "btn"> Funga </a> _
- <a href = "#" class = "btn btn-primary"> Bika impinduka </a>
- </div>
- </div>
Hindura modal ukoresheje JavaScript ukanze buto hepfo. Bizanyerera kandi bishire hejuru yurupapuro.
- <! - Buto yo gukurura modal ->
- <a href = "#myModal" uruhare = "buto" class = "btn" data-toggle = "modal"> Gutangiza uburyo bwa demo </a>
- <! - Modal ->
- <div id = "myModal" class = "modal guhisha fade" tabindex = "-1" uruhare = "ikiganiro" aria-labelledby = "myModalLabel" aria-yihishe = "ukuri" >
- <div class = "modal-umutwe" >
- <buto ubwoko = "buto" urwego = "gufunga" data-gusezerera = "modal" aria-uhishe = "ukuri" > × </button>
- <h3 id = "myModalLabel" > Umutwe wuburyo </h3>
- </div>
- <div class = "modal-umubiri" >
- <p> Umubiri umwe mwiza… </p>
- </div>
- <div class = "modal-footer" >
- <buto icyiciro = "btn" data-gusezerera = "modal" aria-yihishe = "ukuri" > Funga </button>
- <buto icyiciro = "btn btn-primaire" > Bika impinduka </button>
- </div>
- </div>
Kora modal utanditse JavaScript. Shyira data-toggle="modal"
ku kintu kigenzura, nka buto, hamwe na a data-target="#foo"
cyangwa href="#foo"
ugamije uburyo bwihariye bwo guhinduranya.
- <buto ubwoko = "buto" data-toggle = "modal" data-target = "#myModal" > Gutangiza modal </button>
Hamagara modal ifite id myModal
ifite umurongo umwe wa JavaScript:
- $ ( '#myModal' ). modal ( amahitamo )
Amahitamo arashobora kunyuzwa kumurongo wamakuru cyangwa JavaScript. Kubiranga Ibyatanzwe, Ongeraho Izina Izina Kuri data-
, Nka Muri data-backdrop=""
.
Izina | Ubwoko | Mburabuzi | ibisobanuro |
---|---|---|---|
Inyuma | boolean | ni ukuri | Harimo modal-backdrop element. Ubundi, vuga static kuri backdrop idafunze modal kanda. |
Mwandikisho | boolean | ni ukuri | Gufunga modal mugihe urufunguzo rwo guhunga rukanda |
kwerekana | boolean | ni ukuri | Erekana modal mugihe yatangijwe. |
kure | inzira | ibinyoma | Niba url ya kure yatanzwe, ibirimo bizashyirwa muburyo bwa jQuery
|
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' )
Moderi ya Bootstrap yerekana ibintu bike byo guhuza ibikorwa.
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 kubintu byose hamwe niyi plugin yoroshye, harimo na navbar, tabs, n'ibinini.
Ongeraho data-toggle="dropdown"
kumurongo cyangwa buto kugirango uhindure ibitonyanga.
- <div class = "igitonyanga" >
- <a class = "dropdown-toggle" data-toggle = "dropdown" href = "#"> Imbarutso yo guta </a>
- <ul class = "dropdown-menu" uruhare = "menu" aria-labelledby = "dLabel" >
- ...
- </ul>
- </div>
Kugirango URL igumane, koresha data-target
ikiranga aho href="#"
.
- <div class = "igitonyanga" >
- <a class = "dropdown-toggle" id = "dLabel" uruhare = "buto" data-toggle = "dropdown" data-target = "#" href = "/page.html"> _
- Kumanuka
- <b urwego = "caret" > </b>
- </a>
- <ul class = "dropdown-menu" uruhare = "menu" aria-labelledby = "dLabel" >
- ...
- </ul>
- </div>
Hamagara ibitonyanga ukoresheje JavaScript:
- $ ( '.dropdown-toggle' ). kumanuka ()
Nta na kimwe
Porogaramu api yo guhinduranya menu ya navbar yatanzwe cyangwa kugendagenda.
Gucomeka kwa ScrollSpy nuguhita uvugurura intego za nav ukurikije umwanya wizingo. Kuzenguruka agace kari munsi ya navbar hanyuma urebe impinduka zikora. Ibitonyanga byamanuka bizagaragazwa kandi.
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.
Kugirango byoroshye kongeramo imyitwarire ya scrollspy kumurongo wawe wo hejuru, gusa ongera kubintu ushaka kuneka data-spy="scroll"
(cyane cyane iyi yaba umubiri) no data-target=".navbar"
guhitamo nav yo gukoresha. Uzashaka gukoresha imizingo hamwe nibigize .nav
.
- <umubiri wumubiri -maneko = "umuzingo" data-intego = ".navbar" > ... </body>
Hamagara imizingo ukoresheje JavaScript:
- $ ( '#navbar' ). umuzingo ()
<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' )
- });
Amahitamo arashobora kunyuzwa kumurongo wamakuru cyangwa JavaScript. Kubiranga Ibyatanzwe, Ongeraho Izina Izina Kuri data-
, Nka Muri data-offset=""
.
Izina | Ubwoko | Mburabuzi | ibisobanuro |
---|---|---|---|
offset | umubare | 10 | Pixels kugirango uve hejuru iyo ubaze umwanya wumuzingo. |
Icyabaye | Ibisobanuro |
---|---|
gukora | Ibirori birasa igihe cyose ikintu gishya gihinduwe na muzingo. |
Ongeraho byihuse, imbaraga za tab imikorere kugirango uhindurwe unyuze kumurongo wibirimo byaho, 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.
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.
Gushoboza imbonerahamwe ya tabs 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 nav
hamwe nav-tabs
namasomo kuri tab ul
bizashyira mubikorwa Bootstrap.
- <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 = "#home"> 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 na data-ibiranga kubika inyito yaho.
Kubwimpamvu zimikorere, ibikoresho hamwe na popover data-apis bahisemo, bivuze ko ugomba kubitangiza wenyine .
Hisha 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.
Mugihe ukoresheje ibikoresho bya popovers hamwe na Bootstrap yinjiza amatsinda, ugomba gushyiraho container
(inyandiko yanditse hepfo) kugirango wirinde ingaruka zitifuzwa.
Koresha igikoresho ukoresheje JavaScript:
- $ ( '#Urugero' ). ibikoresho ( amahitamo )
Amahitamo arashobora kunyuzwa kumurongo wamakuru cyangwa JavaScript. Kubiranga Ibyatanzwe, Ongeraho Izina Izina Kuri data-
, Nka Muri data-animation=""
.
Izina | Ubwoko | Mburabuzi | ibisobanuro |
---|---|---|---|
animasiyo | boolean | ni ukuri | Koresha css fade inzibacyuho kubikoresho |
html | boolean | ibinyoma | Shyiramo html mubikoresho. Niba ari ibinyoma, uburyo bwa jquery text buzakoreshwa mugushyiramo ibiri muri dom. Koresha inyandiko niba uhangayikishijwe n'ibitero bya XSS. |
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 yibanze' | uburyo ibikoresho byifashishwa - kanda | hover | kwibanda | imfashanyigisho. Menya neza ko watsinze pass trigger mutliple, umwanya watandukanijwe, ubwoko bwa trigger. |
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: |
kontineri | umugozi | ibinyoma | ibinyoma | Ongeraho ibikoresho byibikoresho runaka |
- <a href = "#" data-toggle = "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' )
Hisha kandi usenye ibikoresho bya element.
- $ ( '#element' ). ibikoresho ( 'gusenya' )
Ongeraho uduce duto twibirimo, nkibiri kuri iPad, kubintu byose byo guturamo amakuru yisumbuye. Hisha hejuru ya buto kugirango utere popover. Irasaba Tooltip gushyirwamo.
Amahitamo ane arahari: hejuru, iburyo, hepfo, n'ibumoso.
Sed posuere consectetur est kuri lobortis. Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum.
Sed posuere consectetur est kuri lobortis. Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum.
Sed posuere consectetur est kuri lobortis. Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum.
Sed posuere consectetur est kuri lobortis. Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum.
Nta kimenyetso cyerekanwe nka popovers kiva muri JavaScript nibirimo data
mubiranga.
Gushoboza popovers ukoresheje JavaScript:
- $ ( '#Urugero' ). popover ( amahitamo )
Amahitamo arashobora kunyuzwa kumurongo wamakuru cyangwa JavaScript. Kubiranga Ibyatanzwe, Ongeraho Izina Izina Kuri data-
, Nka Muri data-animation=""
.
Izina | Ubwoko | Mburabuzi | ibisobanuro |
---|---|---|---|
animasiyo | boolean | ni ukuri | Koresha css fade inzibacyuho kubikoresho |
html | boolean | ibinyoma | Shyiramo html muri popover. Niba ari ibinyoma, uburyo bwa jquery text buzakoreshwa mugushyiramo ibiri muri dom. Koresha inyandiko niba uhangayikishijwe n'ibitero bya XSS. |
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 | 'kanda' | uko popover ikurura - kanda | 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: |
kontineri | umugozi | ibinyoma | ibinyoma | Ongeraho popover kubintu runaka |
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' )
Hisha kandi usenye ikintu cya popover.
- $ ( '#element' ). popover ( 'gusenya' )
Ongeraho imikorere yo kwirukana ubutumwa bwose bwamenyeshejwe hamwe niyi plugin.
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 ibisobanuro byose hamwe nibikorwa bya hafi. Kugirango imenyesha ryawe risohoke iyo rifunze, menya neza ko bafite icyiciro .fade
hamwe .in
nicyiciro kimaze kubashyiraho.
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.
* Irasaba plugin yinzibacyuho gushyirwamo.
Twifashishije plugin yo gusenyuka, twubatsemo widget yoroheje yuburyo bwa widget:
- <div class = "akabariro" id = "akayaga2" >
- <div class = "itsinda-ryitsinda" >
- <div class = "imitwe-yumutwe" >
- <a class = "accordion-toggle" data-toggle = "collapse" data-parent = "#accordion2" href = "#collapseOne"> _
- Itsinda rishobora gusenyuka Ingingo # 1
- </a>
- </div>
- <div id = "gusenyukaOne" urwego = "gusenyuka-umubiri-muri" >
- <div class = "akabariro-imbere" >
- Anim pariatur cliche ...
- </div>
- </div>
- </div>
- <div class = "itsinda-ryitsinda" >
- <div class = "imitwe-yumutwe" >
- <a class = "accordion-toggle" data-toggle = "collapse" data-parent = "#accordion2" href = "#collapseTwo"> _
- Itsinda rishobora gusenyuka Ingingo # 2
- </a>
- </div>
- <div id = "gusenyukaTwo" icyiciro = "gusenyuka-umubiri-gusenyuka" >
- <div class = "akabariro-imbere" >
- Anim pariatur cliche ...
- </div>
- </div>
- </div>
- </div>
- ...
Urashobora kandi gukoresha plugin nta marike ya marike. Kora buto kugirango uhindure kwaguka no gusenyuka kwikindi kintu.
- <buto ubwoko = "buto" urwego = "btn btn-akaga" data-toggle = "gusenyuka" data-target = "#demo" >
- byoroshye gusenyuka
- </button>
- <div id = "demo" urwego = "gusenyuka muri" > … </div>
Gusa ongeraho data-toggle="collapse"
na a data-target
kubintu kugirango uhite ugenera kugenzura ikintu gishobora kugwa. Ikiranga data-target
cyemera css guhitamo kugirango akoreshe gusenyuka kuri. Wemeze kongeramo urwego collapse
kubintu bishobora kugwa. Niba wifuza ko byafungura, ongeraho urwego rwinyongera in
.
Kugirango wongere imiyoborere isa nitsinda rishinzwe kugenzura kugabanuka, ongeramo amakuru ikiranga data-parent="#selector"
. Reba kuri demo kugirango ubone ibi mubikorwa.
Gushoboza intoki hamwe na:
- $ ( ".gusenyuka" ). gusenyuka ()
Amahitamo arashobora kunyuzwa kumurongo wamakuru cyangwa JavaScript. Kubiranga Ibyatanzwe, Ongeraho Izina Izina Kuri data-
, Nka Muri data-parent=""
.
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 |
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…
- })
Igicapo gikurikira kirerekana plugin rusange hamwe nibice byo gusiganwa ku magare binyuze mu bintu nka karuseli.
- <div id = "myCarousel" urwego = " slide ya karuseli" >
- <ol urwego = "ibipimo bya karuseli" >
- <li data-target = "#myCarousel" data-slide-to = "0" urwego = "ukora" > </li>
- <li data-target = "#myCarousel" data-slide-to = "1" > </li>
- <li data-target = "#myCarousel" data-slide-to = "2" > </li>
- </ol>
- <! - 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>
Koresha ibiranga amakuru kugirango ugenzure byoroshye umwanya wa karuseli. data-slide
yemera ijambo ryibanze prev
cyangwa next
, rihindura umwanya ugereranije nu mwanya uriho. Ubundi, koresha data-slide-to
kugirango unyuze kumurongo wibanze kuri karuseli data-slide-to="2"
, isimbuka umwanya wa slide kumwanya runaka utangirana na 0
.
Hamagara karuseli intoki hamwe na:
- $ ( '.carousel' ). karuseli ()
Amahitamo arashobora kunyuzwa kumurongo wamakuru cyangwa JavaScriptz. Kubiranga Ibyatanzwe, Ongeraho Ihitamo Izina Kuri data-
, Nka Muri data-interval=""
.
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. |
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.
- <iyinjiza ubwoko = "inyandiko" data-gutanga = "typeahead" >
Uzashaka gushiraho autocomplete="off"
kugirango wirinde ibisanzwe mushakisha iboneka kugaragara hejuru ya Bootstrap yandika.
Ongeraho ibiranga amakuru kugirango wandike ikintu gifite imikorere ya typahead nkuko bigaragara murugero hejuru.
Hamagara imashini yandikishijwe intoki hamwe na:
- $ ( '.ubwoko' ). Imyandikire ()
Amahitamo arashobora kunyuzwa kumurongo wamakuru cyangwa JavaScript. Kubiranga Ibyatanzwe, Ongeraho Izina Izina Kuri data-
, Nka Muri data-source=""
.
Izina | Ubwoko | Mburabuzi | ibisobanuro |
---|---|---|---|
isoko | umurongo, imikorere | [] | Inkomoko yamakuru yo kubaza. Birashobora kuba umurongo wimirongo cyangwa imikorere. Igikorwa cyatsinzwe impaka ebyiri, query agaciro mumwanya winjiza no process guhamagarwa. Imikorere irashobora gukoreshwa mugihe cyo gusubiza inkomoko yamakuru mu buryo butaziguye cyangwa idahwitse binyuze mu process guhamagarwa kwa kimwe. |
ibintu | umubare | 8 | Umubare ntarengwa wibintu byo kwerekana mumanuka. |
Uburebure | umubare | 1 | Uburebure bwinyuguti ntoya ikenewe mbere yo gukurura ibyifuzo byuzuye |
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 . |
kuvugurura | imikorere | Garuka Ikintu cyatoranijwe | Uburyo bwakoreshejwe mugusubiza ikintu cyatoranijwe. Emera impaka imwe, i item kandi ifite urwego rwimyandikire. |
urumuri | imikorere | Kugaragaza Byose Bidasanzwe | Uburyo bukoreshwa mukugaragaza ibisubizo byuzuye. Emera impaka imwe item kandi ifite intera ya typahead urugero. Ugomba gusubira html. |
Itangiza icyinjijwe hamwe nimyandikire.
Subnavigation ibumoso ni demo nzima ya plugin.
Kugirango byoroshye kongeramo imyitwarire ya affix kubintu byose, ongera gusa data-spy="affix"
kubintu ushaka kuneka. Noneho koresha offsets kugirango usobanure igihe cyo guhinduranya pinning yikintu kuri no kuzimya.
- <div data-maneko = "umugereka" data-offset-top = "200" > ... </div>
affix
,
affix-top
na
affix-bottom
. Wibuke kugenzura kubabyeyi bashobora gusenyuka mugihe umugereka utangiye nkuko bivanaho ibintu mubisanzwe byurupapuro.
Hamagara plugin ya affix ukoresheje JavaScript:
- $ ( '#navbar' ). umugereka ()
Amahitamo arashobora kunyuzwa kumurongo wamakuru cyangwa JavaScript. Kubiranga Ibyatanzwe, Ongeraho Izina Izina Kuri data-
, Nka Muri data-offset-top="200"
.
Izina | Ubwoko | Mburabuzi | ibisobanuro |
---|---|---|---|
offset | umubare | imikorere | ikintu | 10 | Pixels kugirango uve kuri ecran mugihe ubara umwanya wumuzingo. Niba umubare umwe watanzwe, offset izashyirwa mubikorwa byombi hejuru no ibumoso. Kumva icyerekezo kimwe, cyangwa offsets nyinshi zidasanzwe, gusa utange ikintu offset: { x: 10 } . Koresha imikorere mugihe ukeneye gutanga dinamike itanga offset (ingirakamaro kubishushanyo mbonera bisubiza). |