E hoʻolaʻa i nā ʻāpana o Bootstrap—i kēia manawa me 12 mau plugins jQuery maʻamau.
ʻO kahi maʻalahi, akā maʻalahi, e lawe i ka plugin javascript modal kuʻuna me ka liʻiliʻi o ka hana pono a me nā paʻamau akamai.
Hoʻohui i nā menus dropdown i nā mea āpau ma Bootstrap me kēia plugin maʻalahi. Hāʻawi ʻo Bootstrap i ke kākoʻo papa kuhikuhi piha i ka navbar, tabs, a me nā pila.
E hoʻohana i ka scrollspy e hoʻohou i nā loulou i kāu navbar e hōʻike i ka loulou hana o kēia manawa ma muli o ke kūlana ʻōwili.
E hoʻohana i kēia plugin no ka hoʻohana ʻana i nā ʻaoʻao a me nā pila ma o ka ʻae ʻana iā lākou e hoʻololi i nā pane tabable o ka ʻike kūloko.
He mea hou i ka jQuery Tipsy plugin, Tooltips ʻaʻole hilinaʻi i nā kiʻi-hoʻohana lākou i ka CSS3 no nā animations a me nā ʻano ʻikepili no ka mālama ʻana i nā inoa kūloko.
Hoʻohui i nā ʻāpana liʻiliʻi o ka ʻike, e like me nā mea ma ka iPad, i kekahi mea no ka ʻike lua hale.
* Pono e hoʻokomo i nā mea hana
ʻO ka plugin alert kahi papa liʻiliʻi no ka hoʻohui ʻana i nā hana kokoke i nā makaʻala.
E hana hou me nā pihi. Hōʻike ka pihi hoʻomalu a i ʻole hana i nā pūʻulu o nā pihi no nā ʻāpana ʻē aʻe e like me nā mea hana.
E kiʻi i nā ʻano kumu a me ke kākoʻo maʻalahi no nā mea hiki ke hoʻoheheʻe ʻia e like me nā accordions a me ka hoʻokele.
E hana i kahi ʻoluʻolu o nā ʻike āu e makemake ai e hāʻawi i kahi kiʻi kiʻiʻoniʻoni pili o ka ʻike.
ʻO kahi plugin maʻalahi i hoʻonui ʻia no ka hana wikiwiki ʻana i nā typeaheads nani me nā ʻano kikokikona.
No nā hopena hoʻololi maʻalahi, e hoʻokomo i ka bootstrap-transition.js i hoʻokahi manawa e paheʻe i nā modals a i ʻole e hoʻopau i nā makaʻala.
* Pono no ka animation i nā plugins
ʻO kahi maʻalahi, akā maʻalahi, e lawe i ka plugin javascript modal kuʻuna me ka liʻiliʻi o ka hana pono a me nā paʻamau akamai.
Hoʻoiho i ka failaAia ma lalo kahi ʻano hoʻohālike statically.
Hoʻokahi kino maikaʻi…
E hoʻololi i kahi modal ma o javascript ma ke kaomi ʻana i ke pihi ma lalo. E paheʻe ia i lalo a mae mai ka piko o ka ʻaoʻao.
E hoʻokuʻu i ka mod demoKāhea i ka modal ma o javascript:
- $ ( '#myModal' ). modal ( koho )
inoa | ʻano ʻano | paʻamau | wehewehe |
---|---|---|---|
kāʻei kua | boolean | ʻoiaʻiʻo | Loaʻa i kahi ʻāpana modal-backdrop. ʻO kahi ʻē aʻe, e kuhikuhi static i kahi backdrop ʻaʻole i pani i ka modal ma ke kaomi. |
keyboard | boolean | ʻoiaʻiʻo | Pani i ka modal ke kaomi ʻia ke kī pakele |
hōʻike | boolean | ʻoiaʻiʻo | Hōʻike i ka modal i ka wā i hoʻomaka ai. |
Hiki iā ʻoe ke hoʻoikaika i nā modals ma kāu ʻaoʻao me ka ʻole e kākau i hoʻokahi laina o javascript. Hoʻonoho wale ʻia data-toggle="modal"
ma kahi mea hoʻoponopono me kahi a i data-target="#foo"
ʻole href="#foo"
e pili ana i kahi id element modal, a ke kaomi ʻia, e hoʻomaka ia i kāu modal.
Eia kekahi, no ka hoʻohui ʻana i nā koho i kāu laʻana modal, e hoʻopili wale iā lākou ma ke ʻano he ʻikepili ʻikepili hou aʻe ma ka mea mana a i ʻole ka markup modal ponoʻī.
- <a class = "btn" data-toggle = "modal" href = "#myModal" > Launch Modal </a>
- <div class = "huna huna" id = "myModal" >
- <div class = "modal-header" >
- < ʻano kī = "pāpā" papa = "kokoke" data-dismiss = "modal" > × </ pihi>
- <h3> Ke poʻo kumu </h3>
- </div>
- <div class = "modal-body" >
- <p> Hoʻokahi kino maikaʻi… </p>
- </div>
- <div class = "modal-footer" >
- <a href = "#" class = "btn" data-dismiss = "modal" > Pani </a>
- <a href = "#" class = "btn btn-primary" > E mālama i nā hoʻololi </a>
- </div>
- </div>
.fade
papa i ka
.modal
element (e nānā i ka demo e ʻike i kēia i ka hana) a hoʻokomo i ka bootstrap-transition.js.
Ho'ā i kāu ʻike ma ke ʻano he modal. ʻAe i kahi koho koho object
.
- $ ( '#myModal' ). ʻano ({
- keyboard : wahahee
- })
Hoʻololi lima i kahi ʻano.
- $ ( '#myModal' ). modal ( 'hoʻololi' )
Wehe lima ia i kahi modal.
- $ ( '#myModal' ). modal ( 'hōʻike' )
Hūnā lima ʻia kahi ʻano.
- $ ( '#myModal' ). modal ( 'huna' )
Hōʻike ka papa modal Bootstrap i kekahi mau hanana no ka hoʻopili ʻana i ka hana modal.
Hanana | wehewehe |
---|---|
hōʻike | Hoʻomaka koke kēia hanana i ke show kāhea ʻia ʻana o ke ʻano hana. |
hōʻike ʻia | Hoʻopau ʻia kēia hanana i ka wā i ʻike ʻia ai ka modal e ka mea hoʻohana (e kali no ka hoʻopau css e hoʻopau). |
huna | Hoʻopau koke ʻia kēia hanana i ka wā hide i kāhea ʻia ai ke ʻano hana. |
hunaia | Hoʻopau ʻia kēia hanana i ka pau ʻana o ka huna ʻana o ka modal mai ka mea hoʻohana (e kali no ka hoʻololi ʻana o css). |
- $ ( '#myModal' ). ma ( 'huna' , hana () {
- // hana i kekahi mea…
- })
Hoʻohui i nā menus dropdown i nā mea āpau ma Bootstrap me kēia plugin maʻalahi. Hāʻawi ʻo Bootstrap i ke kākoʻo papa kuhikuhi piha i ka navbar, tabs, a me nā pila.
Hoʻoiho i ka failaKaomi ma nā loulou nav dropdown ma ka navbar a me nā pila ma lalo e hoʻāʻo i nā hāʻule.
Kāhea i nā hāʻule iho ma o javascript:
- $ ( '.dropdown-toggle' ). hāʻule iho ()
No ka hoʻohui wikiwiki ʻana i ka hana hoʻokuʻu i kekahi mea e hoʻohui wale data-toggle="dropdown"
ʻia a e hoʻāla ʻia nā hāʻule iho bootstrap kūpono.
data-target="#fat"
ʻole
href="#fat"
.
- <ul class = "nav nav-pills" >
- <li class = "active" ><a href = "#" > Loulou mau </a></li>
- <li class = "dropdown" id = "menu1" >
- <a class = "dropdown-toggle" data-toggle = "dropdown" href = "#menu1" >
- hāʻule iho
- <b class = "caret" ></b>
- </a>
- <ul class = "dropdown-menu" >
- <li><a href = "#" > Hana </a></li>
- <li><a href = "#" > Hana hou </a></li>
- <li><a href = "#" > He mea ʻē aʻe ma aneʻi </a></li>
- <li class = "divider" ></li>
- <li><a href = "#" > loulou kaʻawale </a></li>
- </ul>
- </li>
- ...
- </ul>
No ka mālama pono ʻana i nā URL, e hoʻohana i ke data-target
ʻano ma kahi o href="#"
.
- <ul class = "nav nav-pills" >
- <li class = "dropdown" >
- <a class = "dropdown-toggle" data-toggle = "dropdown" data-target = "#" href = "path/to/page.html" >
- hāʻule iho
- <b class = "caret" ></b>
- </a>
- <ul class = "dropdown-menu" >
- ...
- </ul>
- </li>
- </ul>
He polokalamu api no ka ho'āla ʻana i nā menus no kahi hoʻokele hoʻokele i hāʻawi ʻia.
ʻO ka plugin ScrollSpy no ka hoʻonui ʻokoʻa ʻana i nā pahuhopu nav e pili ana i ke kūlana scroll.
Hoʻoiho i ka failaE ʻōwili i ka ʻāpana ma lalo a e nānā i ka hōʻano hou o ka hoʻokele. E hōʻike ʻia nā mea kikoʻī i lalo. E ho'āʻo!
Ad leggings keytar, brunch id art party dolor labore. Pitchfork yr enim lo-fi ma mua o ko lākou kūʻai ʻana aku. Tumblr farm-to-table bike rights i kēlā me kēia mea. Anim keffiyeh carles cardigan. ʻO ka pahu kiʻi a Velit seitan mcsweeney 3 wolf moon irure. ʻO Cosby sweater lomo jean shorts, williamsburg hoodie minim qui ʻaʻole paha ʻoe i lohe iā lākou a me ka cardigan trust fund culpa biodiesel wes anderson aesthetic. Nihil tattooed accusamus, cred irony biodiesel keffiyeh artisan ullamco consequat.
Veniam marfa mustache skateboard, adipisicing fugiat velit pitchfork umiumi. ʻO ka ʻumiʻumi Aliqua cupidatat ka vero a mcsweeney. Cupidatat eha loko nisi, ea helvetica nulla carles. Kalaka meaʻai cosby sweater tattooed, mcsweeney's quis non freegan vinyl. Lo-fi wes anderson +1 sartorial. Carles non aesthetic exercitation quis gentrify. ʻO Brooklyn adipisicing craft beer vice keytar deserunt.
Occaecat commodo aliqua delectus. Fap craft beer deserunt skateboard ea. Loaʻa nā kuleana paʻa paikikala ʻo Lomo i hoʻopaʻa ʻia i ka 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. ʻO Vero VHS ka hoʻololi. Consectetur kekahi ʻeke ʻelele liʻiliʻi DIY. Cred ex in, hoʻomau 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 bag marfa whatever delectus food truck. Sapiente synth id assumenda. Locavore sed helvetica cliche irony, thundercats ʻaʻole paha ʻoe i lohe no lākou consequat hoodie gluten-free lo-fi fap aliquip. Ma mua o ke kūʻai ʻia ʻana aku, ʻo terry richardson proident brunch nesciunt quis cosby sweater pariatur keffiyeh ut helvetica artisan. Cardigan craft beer seitan readymade velit. VHS chambray laboris tempor veniam. Anim mollit minim commodo ullamco thundercats.
Kāhea i ka scrollspy ma o javascript:
- $ ( '#navbar' ). scrollspy ()
No ka hoʻohui maʻalahi i ka hana scrollspy i kāu hoʻokele topbar, e hoʻohui wale data-spy="scroll"
i ka mea āu e makemake ai e kiu (ʻo ka mea maʻamau ʻo ia ke kino).
- <body data-spy = "scroll" > ... </body>
<a href="#home">home</a>
pono e pili i kekahi mea i loko o ka dom e like me
<div id="home"></div>
.
Ke hoʻohana nei i ka scrollspy me ka hoʻohui ʻana a i ʻole ka wehe ʻana i nā mea mai ka DOM, pono ʻoe e kāhea i ke ʻano hoʻomaha e like me:
- $ ( '[data-spy="scroll"]' ). kēlā me kēia ( hana () {
- var $spy = $ ( keia ). scrollspy ( 'refresh' )
- });
inoa | ʻano ʻano | paʻamau | wehewehe |
---|---|---|---|
offset | helu | 10 | Pikika e hoʻoneʻe mai luna mai ke helu ʻana i ke kūlana o ka ʻōwili. |
Hanana | wehewehe |
---|---|
hoʻoikaika | Hoʻomaka kēia hanana i ka wā e hoʻāla ʻia ai kahi mea hou e ka scrollspy. |
Hoʻohui kēia plugin i ka wikiwiki, dynamic tab a me ka hana pila no ka hoʻololi ʻana ma o ka ʻike kūloko.
Hoʻoiho i ka failaKaomi i nā ʻaoʻao ma lalo nei e hoʻololi i waena o nā pane huna, ʻoiai ma o nā papa kuhikuhi.
ʻAʻole paha ʻoe i lohe iā lākou ʻo Jean shorts Austin. Nesciunt tofu stumptown aliqua, retro synth master cleanse. ʻO ka ʻūhā 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 ʻaʻahu ʻAmelika, 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 ma mua o ko lākou kūʻai ʻana aku i ka mahiʻai-to-table VHS viral locavore cosby sweater. Lomo wolf viral, mustache readymade thundercats keffiyeh craft beer marfa ethical. ʻO Wolf salvia freegan, sartorial keffiyeh echo park vegan.
E hoʻā i nā tabable tab ma o javascript (pono e hoʻāla ʻia kēlā me kēia ʻaoʻao):
- $ ( '#myTab a' ). kaomi ( hana ( e ) {
- e . preventDefault ();
- $ ( keia ). tab ( 'hōʻike' );
- })
Hiki iā ʻoe ke hoʻāla i nā pā pākahi ma nā ʻano he nui:
- $ ( '#myTab a[href="#profile"]' ). tab ( 'hōʻike' ); // E koho i ka papa ma ka inoa
- $ ( '#myTab a:mua' ). tab ( 'hōʻike' ); // E koho i ka papa mua
- $ ( '#myTab a:hope' ). tab ( 'hōʻike' ); // E koho i ka papa hope
- $ ( '#myTab li:eq(2) a' ). tab ( 'hōʻike' ); // Koho i ka papa ʻekolu (0-indexed)
Hiki iā ʻoe ke hoʻoikaika i ka ʻaoʻao a i ʻole ka hoʻokele pila me ka kākau ʻole ʻana i kekahi javascript ma ke kuhikuhi wale ʻana a i data-toggle="tab"
ʻole data-toggle="pill"
ma kahi mea. ʻO ka hoʻohui ʻana i nā papa nav
a me nav-tabs
nā papa i ka pā ul
e hoʻopili ai i ke kāʻei ʻana i ka bootstrap tab.
- <ul class = "nav nav-tabs" >
- <li><a href = "#home" data-toggle = "tab" > Home </a></li>
- <li><a href = "#profile" data-toggle = "tab" > Profile </a></li>
- <li><a href = "#messages" data-toggle = "tab" > Nā memo </a></li>
- <li><a href = "#settings" data-toggle = "tab" > Nā hoʻonohonoho </a></li>
- </ul>
Ho'ā i ka ʻeleʻele tab a me ka ipu maʻiʻo. data-target
Pono e loaʻa i ka Tab href
kahi pahu pahu pahu ma ka DOM.
- <ul class = "nav nav-tabs" id = "myTab" >
- <li class = "active" ><a href = "#home" > Home </a></li>
- <li><a href = "#profile" > Profile </a></li>
- <li><a href = "#messages" > Nā memo </a></li>
- <li><a href = "#settings" > Nā hoʻonohonoho </a></li>
- </ul>
- <div class = "ʻaoʻao-papa" >
- <div class = "tab-pane active" id = "home" > ... </div>
- <div class = "tab-pane" id = "profile" > ... </div>
- <div class = "tab-pane" id = "messages" > ... </div>
- <div class = "tab-pane" id = "nā hoʻonohonoho" > ... </div>
- </div>
- <script>
- $ ( hana () {
- $ ( '#myTab a:hope' ). tab ( 'hōʻike' );
- })
- </script>
Hanana | wehewehe |
---|---|
hōʻike | Hoʻomaka kēia hanana ma ka hōʻike pā, akā ma mua o ka hōʻike ʻia ʻana o ka pā hou. E hoʻohana event.target a event.relatedTarget e hoʻopaʻa i ka pā hana a me ka pā hana mua (inā loaʻa). |
hōʻike ʻia | Hoʻomaka kēia hanana ma ka hōʻike pā ma hope o ka hōʻike ʻia ʻana o kahi pā. E hoʻohana event.target a event.relatedTarget e hoʻopaʻa i ka pā hana a me ka pā hana mua (inā loaʻa). |
- $ ( 'a[data-toggle="tab"]' ). ma ( 'hōʻike' , hana ( e ) {
- e . pahu hopu // i hoʻāla ʻia
- e . relatedTarget // tab mua
- })
Hoʻoulu ʻia e ka plugin jQuery.tipsy maikaʻi loa i kākau ʻia e Jason Frame; He mana hou ʻo Tooltips, ʻaʻole hilinaʻi i nā kiʻi, hoʻohana i ka css3 no nā animation, a me nā ʻano ʻikepili no ka mālama ʻana i nā inoa kūloko.
Hoʻoiho i ka failaE kau ma luna o nā loulou ma lalo nei e ʻike i nā ʻōlelo kōkua:
ʻAʻole paha ʻoe i lohe iā lākou. Paʻi kiʻi umiumi maka denim letterpress vegan messenger bag stumptown. Loaʻa iā mcsweeney's fixie sustainable quinoa 8-bit ʻaʻahu ʻAmelika kahi terry richardson vinyl chambray. Beard stumptown, cardigans banh mi lomo thundercats. Tofu biodiesel williamsburg marfa, eha loko mcsweeney's cleanse vegan chambray. He kanaka hana hoʻohenehene i kēlā me kēia keytar , scenester farm-to-table banksy Austin twitter handle freegan cred raw denim single-origin coffee viral.
E hoʻomaka i ka mea hana ma o javascript:
- $ ( '#example' ). mea kōkua ( koho )
inoa | ʻano ʻano | paʻamau | wehewehe |
---|---|---|---|
hoʻouluulu | boolean | ʻoiaʻiʻo | e hoʻopili i kahi hoʻololi css fade i ka mea hana |
hoʻokomo | kaula|hana | 'luna' | pehea e hoʻonoho ai i ka mea hana - top | lalo | waiho | akau |
mea koho | kaulahao | wahahee | Inā hāʻawi ʻia kahi mea koho, e hāʻawi ʻia nā mea hāmeʻa i nā pahuhopu i kuhikuhi ʻia. |
inoa | kaula | hana | '' | ka waiwai poʻo inoa paʻamau inā ʻaʻole i loaʻa ka tag `title` |
hoʻomaka | kaulahao | 'hover' | pehea ka hoʻomaka ʻana o ka mea hana - hover | kālele | manual |
lohi | helu | mea | 0 | hoʻokaʻulua i ka hōʻike ʻana a hūnā i ka mea hana (ms) - ʻaʻole pili i ke ʻano hoʻoiho manual Inā hāʻawi ʻia kahi helu, hoʻopili ʻia ka lohi i ka huna/hōʻike ʻelua ʻO ka hoʻolālā mea: |
No nā kumu hana, ua koho ʻia ka Tooltip a me Popover data-apis.
- <a href = "#" rel = "tooltip" title = "first tooltip" > lele ma luna oʻu </a>
Hoʻopili i kahi mea hoʻohana mea hana i kahi hōʻiliʻili mea.
Hōʻike i ka ʻōlelo kōkua o kahi mea.
- $ ( '#element' ). mea kōkua ( 'hōʻike' )
Hūnā i ka ʻōlelo aʻoaʻo mea paahana.
- $ ( '#element' ). mea kōkua ( 'huna' )
Hoʻololi i ka ʻōlelo kōkua o kekahi mea.
- $ ( '#element' ). mea kōkua ( 'hoʻololi' )
Hoʻohui i nā ʻāpana liʻiliʻi o ka ʻike, e like me nā mea ma ka iPad, i kekahi mea no ka ʻike lua hale.
* Pono e hoʻokomo ʻia ka mea hana
Hoʻoiho i ka failaE kau ma luna o ke pihi e hoʻomaka i ka popover.
E hoʻā i nā popovers ma o javascript:
- $ ( '#example' ). popover ( koho )
inoa | ʻano ʻano | paʻamau | wehewehe |
---|---|---|---|
hoʻouluulu | boolean | ʻoiaʻiʻo | e hoʻopili i kahi hoʻololi css fade i ka mea hana |
hoʻokomo | kaula|hana | 'akau' | pehea e hoʻonoho ai i ka popover - top | lalo | waiho | akau |
mea koho | kaulahao | wahahee | inā hāʻawi ʻia kahi mea koho, e hāʻawi ʻia nā mea hāmeʻa i nā pahuhopu i kuhikuhi ʻia |
hoʻomaka | kaulahao | 'hover' | pehea ka hoʻomaka ʻana o ka mea hana - hover | kālele | manual |
inoa | kaula | hana | '' | ka waiwai poʻo inoa paʻamau inā ʻaʻole i loaʻa ke ʻano `title` |
maʻiʻo | kaula | hana | '' | waiwai maʻiʻo paʻamau inā ʻaʻole i loaʻa ke ʻano `data-content` |
lohi | helu | mea | 0 | hoʻokaʻulua i ka hōʻike ʻana a hūnā i ka popover (ms) - ʻaʻole pili i ke ʻano hoʻoiho manual Inā hāʻawi ʻia kahi helu, hoʻopili ʻia ka lohi i ka huna/hōʻike ʻelua ʻO ka hoʻolālā mea: |
No nā kumu hana, ua koho ʻia ka Tooltip a me Popover data-apis.
Hoʻomaka i nā popovers no kahi hōʻiliʻili mea.
Hōʻike i kahi mea popover.
- $ ( '#element' ). popover ( 'hōʻike' )
Hūnā i ka popover element.
- $ ( '#element' ). popover ( 'huna' )
Hoʻololi i ka popover element.
- $ ( '#element' ). popover ( 'hoʻololi' )
ʻO ka plugin alert kahi papa liʻiliʻi no ka hoʻohui ʻana i nā hana kokoke i nā makaʻala.
HoʻoihoHoʻohana ka plugin alerts i nā memo makaʻala maʻamau, a poloka i nā memo.
E hoʻololi i kēia a me kēlā a hoʻāʻo hou. Duis mollis, est non commodo luctus, nisi erat porttitor ligula, eget lacinia odio sem nec elit. Cras mattis consectetur purus noho amet fermentum.
E ʻae i ka wehe ʻana i kahi makaʻala ma o javascript:
- $ ( ".alert" ). makaʻala ()
E hoʻohui wale data-dismiss="alert"
i kāu pihi pani e hāʻawi ʻakomi i kahi hana kokoke.
- <a class = "close" data-dismiss = "alert" href = "#" > × </a>
Hoʻopili i nā mākaʻikaʻi āpau me ka hana kokoke. I mea e hoʻolalelale ai kāu mau makaʻala i ka wā i pani ʻia ai, e ʻike pono ua pili ka papa .fade
a me .in
ka papa iā lākou.
Pani i kahi makaʻala.
- $ ( ".alert" ). makaʻala ( 'close' )
Hōʻike ka papa makaʻala o Bootstrap i kekahi mau hanana no ka hoʻopili ʻana i ka hana makaʻala.
Hanana | wehewehe |
---|---|
pili | Hoʻomaka koke kēia hanana i ke close kāhea ʻia ʻana o ke ʻano hana. |
pani ʻia | Hoʻopau ʻia kēia hanana i ka wā i pani ʻia ai ka makaʻala (e kali no ka hoʻololi ʻana o css). |
- $ ( '#my-alert' ). hoʻopaʻa ( 'pani ' , hana () {
- // hana i kekahi mea…
- })
E kiʻi i nā ʻano kumu a me ke kākoʻo maʻalahi no nā mea hiki ke hoʻoheheʻe ʻia e like me nā accordions a me ka hoʻokele.
Hoʻoiho i ka faila* Pono e hoʻokomo i ka plugin Transitions.
Ke hoʻohana nei i ka collapse plugin, kūkulu mākou i kahi widget style accordion maʻalahi:
E ho'ā ma o javascript:
- $ ( ".collapse" ). hāʻule ()
inoa | ʻano ʻano | paʻamau | wehewehe |
---|---|---|---|
makua | mea koho | wahahee | Inā koho ʻia, e pani ʻia nā mea hiki ke hoʻoheheʻe ʻia ma lalo o ka makua i ʻōlelo ʻia ke hōʻike ʻia kēia mea hiki. (e like me ka hana accordion kuʻuna) |
hoʻololi | boolean | ʻoiaʻiʻo | Hoʻololi i ka mea hiki ke collapsible ma ke kāhea ʻana |
E hoʻohui wale data-toggle="collapse"
a me ka mea data-target
i ka mea e hoʻonoho ʻakomi i ka mana o kahi mea hiki ke collapsible. ʻAe ke data-target
ʻano i kahi koho css e hoʻopili ai i ka hāʻule. E hōʻoia e hoʻohui i ka papa collapse
i ka mea hiki ke collapsible. Inā makemake ʻoe e wehe paʻamau, e hoʻohui i ka papa hou in
.
- <pāpā pāʻani = " btn btn-danger" data-toggle = "collapse" data-target = "#demo" >
- maʻalahi hiki ke collapsible
- </ pihi>
- <div id = "demo" class = "collapse in" > … </div>
data-parent="#selector"
. E nānā i ka demo e ʻike i kēia i ka hana.
Ho'ā i kāu ʻike ma ke ʻano he mea hiki ke collapsible. ʻAe i kahi koho koho object
.
- $ ( '#myCollapsible' ). hāʻule ({
- hoololi : wahahee
- })
Hoʻololi i kahi mea hiki ke hōʻike ʻia a hūnā ʻia paha.
Hōʻike i kahi mea hiki ke collapsible.
Hūnā i kahi mea hiki ke collapsible.
Hōʻike ka papa hāʻule o Bootstrap i kekahi mau hanana no ka hoʻopili ʻana i ka hana hāʻule.
Hanana | wehewehe |
---|---|
hōʻike | Hoʻomaka koke kēia hanana i ke show kāhea ʻia ʻana o ke ʻano hana. |
hōʻike ʻia | Hoʻopau ʻia kēia hanana i ka wā i ʻike ʻia ai kahi mea hāʻule i ka mea hoʻohana (e kali no ka pau ʻana o nā hoʻololi css). |
huna | Hoʻopau koke ʻia kēia hanana ke hide kāhea ʻia ke ʻano. |
hunaia | Hoʻopau ʻia kēia hanana i ka wā i hūnā ʻia ai kahi mea hāʻule mai ka mea hoʻohana (e kali i ka hoʻololi ʻana o css). |
- $ ( '#myCollapsible' ). ma ( 'huna' , hana () {
- // hana i kekahi mea…
- })
ʻO kahi plugin maʻamau no ka holo kaʻa ʻana ma waena o nā mea. He kaapuni lealea.
Hoʻoiho i ka failaE nānā i ka slideshow ma lalo nei.
Kāhea ma javascript:
- $ ( '.carousel' ). carousel ()
inoa | ʻano ʻano | paʻamau | wehewehe |
---|---|---|---|
waena | helu | 5000 | ʻO ka nui o ka manawa e hoʻopaneʻe ai ma waena o ke kaʻa ʻakomi i kahi mea. Inā hoʻopunipuni, ʻaʻole e holo ʻokoʻa ka carousel. |
hoʻomaha | kaulahao | "holo" | Hoʻomaha i ke kaʻa kaʻa o ka carousel ma ka ʻiole komo a hoʻomaka hou i ke kaʻa kaʻa o ka carousel ma ka ʻiole. |
Hoʻohana ʻia nā hiʻohiʻona ʻikepili no nā mana mua a me nā mea aʻe. E nānā i ka hōʻailona hōʻailona ma lalo nei.
- <div id = "myCarousel" class = "carousel slide" >
- <!-- Nā mea Carousel -->
- <div class = "carousel-inner" >
- <div class = "mea hana" > … </div>
- <div class = "item" > … </div>
- <div class = "item" > … </div>
- </div>
- <!-- Carousel nav -->
- <a class = "carousel-control left" href = "#myCarousel" data-slide = "prev" > ‹ </a>
- <a class = "carousel-control right" href = "#myCarousel" data-slide = "next" > › </a>
- </div>
Hoʻomaka ka carousel me nā koho koho object
a hoʻomaka i ka holo kaʻa i nā mea.
- $ ( '.carousel' ). carousel ({
- kaawale : 2000
- })
Kaʻapuni i nā mea carousel mai ka hema a i ka ʻākau.
Hoʻopau i ka carousel mai ka holo paikikala ma nā mea.
Hoʻololi i ka carousel i kahi kiʻi kikoʻī (ma muli o 0, e like me kahi array).
Hoʻoholo i ka mea mua.
Hoʻoholo i ka mea aʻe.
Hōʻike ka papa carousel o Bootstrap i ʻelua hanana no ka hoʻopili ʻana i ka hana carousel.
Hanana | wehewehe |
---|---|
pahee | Hoʻopau koke ʻia kēia hanana i ka wā slide e kāhea ʻia ke ʻano hana. |
pahee | Hoʻopau ʻia kēia hanana ke hoʻopau ka carousel i kāna hoʻololi paheʻe. |
ʻO kahi plugin maʻalahi i hoʻonui ʻia no ka hana wikiwiki ʻana i nā typeaheads nani me nā ʻano kikokikona.
Hoʻoiho i ka failaE hoʻomaka i ka paʻi ʻana ma ke kahua ma lalo nei e hōʻike i nā hualoaʻa typeahead.
Kāhea i ka typeahead ma o javascript:
- $ ( '.typeahead' ). poʻomanaʻo ()
inoa | ʻano ʻano | paʻamau | wehewehe |
---|---|---|---|
kumu | pūʻulu | [ ] | ʻO ke kumu ʻikepili e nīnau ai. |
mau mea | helu | 8 | Ka helu kiʻekiʻe o nā mea e hōʻike ʻia ma ka hāʻule iho. |
mea hoʻokūkū | hana | hihia ʻole | ʻO ke ala i hoʻohana ʻia e hoʻoholo ai inā pili kekahi nīnau i kahi mea. ʻAe ʻo ia i kahi hoʻopaʻapaʻa hoʻokahi, ʻo item ia ka mea e hoʻāʻo ai i ka nīnau. E komo i ka nīnau o kēia manawa me this.query . E hoʻihoʻi i kahi boolean true inā pili ka nīnau. |
mea hoʻokaʻawale | hana | kūlike pololei, hihia pili, hihia ʻole |
Hoʻohana ʻia no ka hoʻokaʻawale ʻana i nā hopena autocomplete. E ʻae i kahi hoʻopaʻapaʻa hoʻokahi items a loaʻa iā ia ka laulā o ka laʻana typeahead. E kuhikuhi i ka nīnau o kēia manawa me this.query . |
mea hōʻailona | hana | hōʻike i nā pāʻani paʻamau a pau | Hoʻohana ʻia ke ʻano no ka hōʻike ʻana i nā hopena autocomplete. E ʻae i kahi hoʻopaʻapaʻa hoʻokahi item a loaʻa iā ia ka laulā o ka laʻana typeahead. Pono e hoʻihoʻi i ka html. |
Hoʻohui i nā hiʻohiʻona ʻikepili e hoʻopaʻa inoa i kahi mea me ka hana typeahead.
- <input type = "text" data-provide = "typeahead" >
Hoʻomaka i kahi hoʻokomo me kahi poʻo kikokiko.