Aumai vaega a Bootstrap i le ola-lea ua i ai nei 13 faʻapipiʻi masani jQuery.
E mafai ona fa'aofi fa'apipi'i ta'ito'atasi (e ui o nisi e mana'omia fa'alagolago), po'o fa'atasi uma. O le bootstrap.js ma le bootstrap.min.js o loʻo iai uma faʻapipiʻi i se faila e tasi.
E mafai ona e fa'aogaina uma Bootstrap plugins mama e ala i le fa'ailoga API e aunoa ma le tusiaina o se laina se tasi o le JavaScript. O le API vasega muamua lea a Bootstrap ma e tatau ona avea ma au iloiloga muamua pe a faʻaaogaina se masini.
Na faapea mai, i nisi tulaga atonu e manaʻomia e tape lenei galuega. O le mea lea, matou te tu'uina atu fo'i le agava'a e fa'amalo ai le fa'amatalaga uiga API e ala i le tatalaina o mea uma na tutupu i luga o le igoa o le tino fa'atasi ma le `'data-api'`. E pei o lenei:
- $ ( 'tino' ). tape ( '.data-api' )
I le isi itu, e faʻatatau i se mea faʻapipiʻi faʻapitoa, naʻo le faʻapipiʻiina o le igoa ole plugin o se igoa avanoa faʻatasi ai ma le data-api namespace pei o lenei:
- $ ( 'tino' ). pe ( '.alert.data-api' )
Matou te talitonu foi e tatau ona e faʻaogaina uma Bootstrap plugins mama e ala i le JavaScript API. O API fa'alaua'itele uma e tasi, auala e mafai ona filifili, ma toe fa'afo'i le aoina na fa'atino.
- $ ( ".btn.danger" ). faamau ( "toggle" ). addClass ( "ga'o" )
O metotia uma e tatau ona talia se mea e filifili ai filifiliga, se manoa e faʻatatau i se metotia faʻapitoa, poʻo leai se mea (lea e amataina ai se faʻapipiʻi ma amioga le lelei):
- $ ( "#myModal" ). modal () // amataina i faaletonu
- $ ( "#myModal" ). modal ({ keyboard : false }) // amataina e aunoa ma se piano
- $ ( "#myModal" ). modal ( 'fa'aali' ) // amataina ma vala'au fa'aalia vave
E fa'aalia fo'i e fa'apipi'i ta'itasi lona faufale mata'utia i luga o se meatotino `Fausia': $.fn.popover.Constructor
. Afai e te manaʻo e maua se faʻataʻitaʻiga faʻapitoa faʻapipiʻi, aumai saʻo mai se elemene: $('[rel=popover]').data('popover')
.
O nisi taimi e manaʻomia le faʻaogaina o Bootstrap plugins ma isi faʻavae UI. I ia tulaga, e mafai ona tupu i nisi taimi le fete'ena'iga o igoa. Afai e tupu lenei mea, e mafai ona e valaʻau .noConflict
i le plugin e te manaʻo e toe faʻafoʻi le tau o.
- var bootstrapButton = $ . fn . faamau . noConflict () // toe faafoi le $.fn.button i le tau na tofia muamua
- $ . fn . bootstrapBtn = bootstrapButton // tu'u $().bootstrapBtn le fa'atinoina o galuega
O le Bootstrap e maua ai mea faʻapitoa mo le tele o gaioiga faʻapitoa a le plugin. E masani lava, o nei mea e sau i se fa'ailoga fa'apitoa ma fa'asologa ua mavae - lea e fa'aosoina ai le infinitive (ex. show
) i le amataga o se mea na tupu, ma lona fa'ailoga participle ua mavae (ex. shown
) e fa'aosoina pe a mae'a se gaioiga.
O mea uma e le fa'ai'u e maua ai le fa'atinoga o le preventDefault. O lenei mea e maua ai le malosi e taofi ai le faʻatinoina o se gaioiga aʻo leʻi amataina.
- $ ( '#myModal' ). i luga ( 'fa'aali' , galuega ( e ) {
- afai (! data ) toe fo'i u . preventDefault () // taofi le modal mai le faʻaalia
- })
Mo a'afiaga faigofie o suiga, fa'aofi bootstrap-transition.js fa'atasi ma isi faila JS. Afai o loʻo e faʻaaogaina le bootstrap.js tuʻufaʻatasia , e leai se mea e manaʻomia e faʻapipiʻi ai lenei mea-ua uma ona iai.
O nai faʻataʻitaʻiga o le suiga faʻapipiʻi:
O auala e fa'afaigofie, ae fetu'una'i, fa'asalalauga fa'atasi ma le fa'aitiitiga mana'omia ma fa'aletonu atamai.
Se fa'atusa fa'atusa fa'atasi ai ma ulutala, tino, ma se seti o gaioiga i le vae.
E tasi le tino lelei…
- <div class = "modal hide fade" >
- <div class = "modal-header" >
- <button type = "button" class = "close" data-dismiss = "modal" aria-natia = "moni" > &taimi; </fa'amau>
- <h3> Ulutala fa'atatau </h3>
- </div>
- <div class = "modal-body" >
- <p> Tasi le tino lelei... </p>
- </div>
- <div class = "modal-footer" >
- <a href = "#" class = "btn" > Tapuni </a>
- <a href = "#" class = "btn btn-primary" > Sefe suiga </a>
- </div>
- </div>
Su'e se fa'aoga e ala ile JavaScript ile kilikiina ole ki lalo. O le a fa'ase'e ifo i lalo ma mou atu mai le pito i luga o le itulau.
- <!-- Fa'amau e fa'aoso ai le fa'asologa -->
- <a href = "#myModal" role = "button" class = "btn" data-toggle = "modal" > Tatala fa'ata'ita'iga auala </a>
- <!-- Modal -->
- <div id = "myModal" vasega = "fade natia tupe" tabindex = "-1" role = "dialog" aria-labelledby = "myModalLabel" aria-natia = "moni" >
- <div class = "modal-header" >
- <button type = "button" class = "close" data-dismiss = "modal" aria-hidden = "moni" > × </button>
- <h3 id = "myModalLabel" > Ulutala fa'atatau </h3>
- </div>
- <div class = "modal-body" >
- <p> Tasi le tino lelei... </p>
- </div>
- <div class = "modal-footer" >
- <button class = "btn" data-dismiss = "modal" aria-hidden = "true" > Tapuni </ button>
- <button class = "btn btn-primary" > Fa'asao suiga </button>
- </div>
- </div>
Fa'agaoioia se faiga e aunoa ma le tusia o le JavaScript. Seti data-toggle="modal"
i luga o se elemene e pulea, pei o se faamau, faatasi ai ma se data-target="#foo"
po href="#foo"
o le taulaʻi i se faiga faʻapitoa e fesuiaʻi.
- <button type = "button" data-toggle = "modal" data-target = "#myModal" > Fa'alauiloa auala </button>
Valaau se modal ma id myModal
ma se laina e tasi o le JavaScript:
- $ ( '#myModal' ). modal ( filifiliga )
O filifiliga e mafai ona pasia e ala i faʻamatalaga uiga poʻo le JavaScript. Mo fa'amatalaga uiga, fa'aopoopo le igoa filifiliga i le data-
, pei o le data-backdrop=""
.
Igoa | ituaiga | faaletonu | fa'amatalaga |
---|---|---|---|
tuaa | boolean | moni | E aofia ai se elemene fa'aola-backdrop. I le isi itu, fa'amaoti static mo se fa'ata'atia e le tapuni ai le auala ile kiliki. |
piano | boolean | moni | Tapuni le auala pe a oomi le ki sola |
fa'aali | boolean | moni | Fa'aalia le faiga pe'ā amata. |
mamao | ala | pepelo | Afai e tuʻuina atu se url mamao, o le a utaina mea e ala i le
|
Fa'agaoioia lau anotusi e fai ma fa'ata'ita'iga. Talia se filifiliga faitalia object
.
- $ ( '#myModal' ). auala ({
- piano : sese
- })
Su'e ma le lima se faiga.
- $ ( '#myModal' ). modal ( 'toggle' )
Tatala ma le lima se auala.
- $ ( '#myModal' ). modal ( 'fa'aali' )
Natia ma le lima se auala.
- $ ( '#myModal' ). modal ( 'natia' )
O le vasega fa'apitoa a Bootstrap o lo'o fa'aalia ai ni nai mea na tutupu mo le fa'aogaina o galuega fa'atino.
Mea na tupu | Fa'amatalaga |
---|---|
fa'aali | E mu vave lenei mea pe a show valaʻau le auala faʻataʻitaʻiga. |
faaalia | O lenei mea na tupu e faʻamalo pe a faʻaalia le modal i le tagata faʻaoga (o le a faʻatali mo suiga css e maeʻa). |
lalafi | O lenei mea na tupu e faʻamalo vave pe a hide valaʻau le auala faʻataʻitaʻiga. |
natia | O lenei mea e tupu pe a maeʻa ona natia le modal mai le tagata faʻaoga (o le a faʻatali mo suiga css e maeʻa). |
- $ ( '#myModal' ). i luga ( 'natia' , galuega () {
- // fai se mea...
- })
Fa'aopoopo i lalo menus i le toetoe lava o so'o se mea fa'atasi ma lenei fa'aoga faigofie, e aofia ai le navbar, tabs, ma pills.
Fa'aopoopo data-toggle="dropdown"
i se so'oga po'o se fa'amau e fa'asolo i lalo.
- <div class = "pa'u i lalo" >
- <a class = "dropdown-toggle" data-toggle = "dropdown" href = "#" > Dropdown trigger </a>
- <ul class = "dropdown-menu" role = "menu" aria-labelledby = "dLabel" >
- ...
- </ul>
- </div>
Ina ia fa'atumauina URL, fa'aoga le data-target
uiga nai lo le href="#"
.
- <div class = "pa'u i lalo" >
- <a class = "pa'ū-toggle" id = "dLabel" role = "button" data-toggle = "dropdown" data-target = "#" href = "/page.html" >
- Pa'u i lalo
- <b class = "caret" ></b>
- </a>
- <ul class = "dropdown-menu" role = "menu" aria-labelledby = "dLabel" >
- ...
- </ul>
- </div>
Valaau le to'alalo e ala i le JavaScript:
- $ ( '.dropdown-toggle' ). pa'u i lalo ()
Leai
O se api fa'akomepiuta mo le fesuia'iina o menus mo se navbar ua tu'uina atu po'o le fa'ailoga fa'apipi'i.
O le ScrollSpy plugin e mo le fa'afouina otometi fa'atatau i luga ole laiga e fa'atatau ile tulaga ta'ai. Fa'asolo le vaega i lalo o le navbar ma matamata le suiga o le vasega. O le a fa'amaninoina fo'i le fa'ailoga pito i lalo.
Ad leggings keytar, brunch id art party dolor laboure. Pitchfork yr enim lo-fi ae le'i fa'atau atu. Tumblr farm-to-table uila aia tatau po o le a lava. Anim keffiyeh carles cardigan. Velit seitan mcsweeney's photo booth 3 wolf moon irure. Cosby sweater lomo jean shorts, williamsburg hoodie minim qui masalo e te le'i faalogo iai ma cardigan trust fund culpa biodiesel wes anderson aesthetic. Nihil tattooed accusamus, cred irony biodiesel keffiyeh artisan ullamco consequat.
Veniam marfa mustache laupapa, adipisicing fugiat velit pitchfork 'ava. Freegan beard aliqua cupidatat mcsweeney's vero. Cupidatat fa loko nisi, ea helvetica nulla carles. Ta'u mea'ai ta'avale cosby pe'a, 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 delectus. Fap craft beer deserunt skateboard ea. Lomo uila aia tatau 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. O le Vero VHS o le faʻaleleia. Consectetur nisi DIY minim avefe'au ato. Cred ex in, sustainable 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 avefe'au ato marfa so'o se loli meaai. Sapiente synth id assumenda. Locavore sed helvetica cliche irony, thundercats masalo e te le'i faalogo ia i latou consequat hoodie gluten-free lo-fi fap aliquip. Laboure elit placeat ae le'i fa'atau atu, 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.
Ina ia fa'afaigofie ona fa'aopoopo le amio ta'avale i lau ta'avale pito i luga, na'o le fa'aopoopo data-spy="scroll"
i le elemene e te mana'o e sipai ai (sili ona masani o le tino lea) ma data-target=".navbar"
filifili po'o fea nav e fa'aoga. E te mana'o e fa'aoga scrollspy ma se .nav
vaega.
- <body data-spy = "scroll" data-target = ".navbar" > ... </body>
Valaau le scrollspy e ala i le JavaScript:
- $ ( '#navbar' ). scrollspy ()
<a href="#home">home</a>
tatau ona fetaui ma se mea i totonu o le fale e pei o
<div id="home"></div>
.
A faʻaaoga le scrollspy faʻatasi ma le faʻaopoopoina poʻo le aveesea o elemene mai le DOM, e tatau ona e valaʻau le auala faʻafouina e pei o lea:
- $ ( '[data-spy="scroll"]' ). taitasi ( galuega ( ) {
- var $spy = $ ( lenei ). scrollspy ( 'refresh' )
- });
O filifiliga e mafai ona pasia e ala i faʻamatalaga uiga poʻo le JavaScript. Mo fa'amatalaga uiga, fa'aopoopo le igoa filifiliga i le data-
, pei o le data-offset=""
.
Igoa | ituaiga | faaletonu | fa'amatalaga |
---|---|---|---|
fa'apena | numera | 10 | Pixels e fa'asolo mai luga pe a fa'atatau le tulaga o le ta'ai. |
Mea na tupu | Fa'amatalaga |
---|---|
fa'agaoioi | E mu lenei mea i so'o se taimi e fa'agaoioi ai se mea fou e le scrollspy. |
Fa'aopoopo le fa'agaioiga fa'agaoioiga fa'avavevave ma fa'amalosi i le fa'aliliuina i fa'amalama o mea fa'apitonu'u, e o'o lava ile fa'aulu i lalo menus.
Raw denim masalo e te le'i fa'alogo i ai Jean shorts 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. Faʻafeiloaʻi i le salvia cillum iphone. Seitan aliquip quis cardigan ofu Amerika, 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.
Fa'aaga tabbable tabs e ala i le JavaScript (ta'itasi ta'itasi e mana'omia ona fa'agaoioia ta'ito'atasi):
- $ ( '#myTab a' ). kiliki ( galuega ( e ) {
- e . preventDefault ();
- $ ( lenei ). tab ( 'fa'aali' );
- })
E mafai ona e fa'agaoioia ta'iala ta'itasi i le tele o auala:
- $ ( '#myTab a[href="#profile"]' ). tab ( 'fa'aali' ); // Filifili le lisi ile igoa
- $ ( '#myTab a:muamua' ). tab ( 'fa'aali' ); // Filifili le laupepa muamua
- $ ( '#myTab a:muli' ). tab ( 'fa'aali' ); // Filifili le laupepa mulimuli
- $ ( '#myTab li:eq(2) a' ). tab ( 'fa'aali' ); // Filifili le laupepa lona tolu (0-indexed)
E mafai ona e fa'agaoioia se fa'ailoga po'o se pill navigation e aunoa ma le tusiaina o so'o se JavaScript i le na'o le fa'ama'oti data-toggle="tab"
po'o data-toggle="pill"
luga o se elemene. O le fa'aopoopoina o le nav
ma nav-tabs
vasega i le fa'ailoga o le ul
a fa'aogaina ai le fa'ailoga o le Bootstrap tab.
- <ul class = "nav nav-tabs" >
- <li><a href = "#home" data-toggle = "tab" > Fale </a></li>
- <li><a href = "#profile" data-toggle = "tab" > Tala'aga </a></li>
- <li><a href = "#messages" data-toggle = "tab" > Feau </a></li>
- <li><a href = "#settings" data-toggle = "tab" > Seti </a></li>
- </ul>
Fa'aagaoioia se fa'ailoga elemene ma mea o lo'o i totonu. O le Tab e tatau ona i ai se data-target
poʻo se href
faʻatatau i se pusa pusa i le DOM.
- <ul class = "nav nav-tabs" id = "myTab" >
- <li class = "active" ><a href = "#home" > Home </a></li>
- <li><a href = "#profile" > Tala'aga </a></li>
- <li><a href = "#messages" > Savali </a></li>
- <li><a href = "#settings" > Fa'atonu </a></li>
- </ul>
- <div class = "tab-content" >
- <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 = "settings" > ... </div>
- </div>
- <script>
- $ ( galuega () {
- $ ( '#myTab a:muli' ). tab ( 'fa'aali' );
- })
- </script>
Mea na tupu | Fa'amatalaga |
---|---|
fa'aali | O lenei mea na tupu e mu i luga o faʻaaliga faʻaaliga, ae leʻi faʻaalia le faʻailoga fou. Fa'aoga event.target ma event.relatedTarget fa'atatau i le ta'i ga'oi ma le fa'agaioiga muamua (pe a maua) ta'itasi. |
faaalia | O lenei mea na tupu e mu i luga o le faʻaaliga faʻapipiʻi pe a uma ona faʻaalia se tab. Fa'aoga event.target ma event.relatedTarget fa'atatau i le ta'i ga'oi ma le fa'agaioiga muamua (pe a maua) ta'itasi. |
- $ ( 'a[data-toggle="tab"]' ). i luga ( 'fa'aalia' , galuega ( e ) {
- e . sini // fa'agaoioia tab
- e . relatedTarget // tab muamua
- })
Musuia e le sili jQuery.tipsy plugin tusia e Jason Frame; Tooltips o se fa'afouga fou, e le fa'alagolago i ata, fa'aoga le CSS3 mo fa'afiafiaga, ma fa'amaumauga-uiga mo le teuina o suafa fa'apitonu'u.
Mo mafua'aga o fa'atinoga, o le tooltip ma le popover data-apis o lo'o filifili i totonu, o lona uiga e tatau ona e amataina oe lava ia .
Fa'apa i luga o so'oga o lo'o i lalo e va'ai i mea faigaluega:
ofuvae fufusi isi tulaga keffiyeh masalo e te le'i fa'alogo iai. Fa'ato'aga ata 'ava fa'a denim mata'itusi vegan taga avefe'au stumptown. Farm-to-table seitan, mcsweeney's fixie sustainable quinoa 8-bit amerika ofu e iai le terry richardson vinyl chambray. Beard stumptown, cardigans banh mi lomo thundercats. Tofu biodiesel williamsburg marfa, fa loko mcsweeney's cleanse vegan chambray. O se tufuga fa'atauva'a lava so'o se keytar , scenester farm-to-table banksy Austin twitter handle freegan cred raw denim single-origin coffee viral.
A fa'aoga meafaigaluega ma popovers fa'atasi ai ma vaega fa'aoga a Bootstrap, e tatau ona e setiina le container
(fa'amauina i lalo) filifiliga e aloese ai mai a'afiaga e le mana'omia.
Fa'aoso le mea faigaluega e ala ile JavaScript:
- $ ( '#fa'ata'ita'iga' ). mea faigaluega ( filifiliga )
O filifiliga e mafai ona pasia e ala i faʻamatalaga uiga poʻo le JavaScript. Mo fa'amatalaga uiga, fa'aopoopo le igoa filifiliga i le data-
, pei o le data-animation=""
.
Igoa | ituaiga | faaletonu | fa'amatalaga |
---|---|---|---|
animation | boolean | moni | fa'aoga se suiga e mou atu css i le mea faigaluega |
html | boolean | pepelo | Fa'aofi le html i totonu o le meafaigaluega. Afai e sese, o le a faʻaaogaina le text metotia a le jquery e faʻapipiʻi ai mea i totonu o le dom. Fa'aoga tusitusiga pe a e popole i osofa'iga a le XSS. |
tu'uga | manoa | galuega faatino | 'pito' | fa'afefea ona fa'atulaga le mea faigaluega - pito i luga | lalo | agavale | tauagavale |
tagata filifilia | manoa | pepelo | Afai e tu'uina atu se tagata filifilia, o mea fa'aoga meafaigaluega o le a tu'uina atu i sini fa'apitoa. |
suafa | manoa | galuega faatino | '' | fa'aigoa fa'aigoa pe afai e le o iai le pine o le 'igoa' |
fa'aoso | manoa | 'ave le taulai' | pe fa'afefea ona fa'aosoina meafaigaluega - kiliki | lele | taula'i | tusi lesona. Fa'ailoa lau mataupu pasi fa'aoso mutliple, vaeluaga avanoa, fa'aoso ituaiga. |
tuai | numera | mea faitino | 0 | fa'atuai ona fa'aali ma nana le mea faigaluega (ms) - e le fa'atatau ile ituaiga fa'aoso tusi Afai e tu'uina atu se numera, fa'atuai e fa'aoga i natia/fa'aali uma O le fausaga o mea faitino o le: |
pusa | manoa | pepelo | pepelo | Fa'apipi'i le mea faigaluega i se elemene fa'apitoa |
- <a href = "#" data-toggle = "tooltip" title = "first tooltip" > fa'ae'e i luga o a'u </a>
Fa'apipi'i se tu'u fa'amatalaga meafaigaluega i se aoina elemene.
Fa'aalia le mea faigaluega o se elemene.
- $ ( '#elemene' ). meafaigaluega ( 'fa'aali' )
Natia le mea faigaluega o se elemene.
- $ ( '#elemene' ). meafaigaluega ( 'natia' )
Su'e le pito meafaigaluega a se elemene.
- $ ( '#elemene' ). mea faigaluega ( ' toggle ' )
Natia ma fa'aleagaina le fa'aoga meafaigaluega.
- $ ( '#elemene' ). meafaigaluega ( 'fa'aumatia' )
Fa'aopoopo ni fa'aputuga laiti o mea, pei o i luga ole iPad, i so'o se elemene mo fa'amatalaga lona lua o fale. Fa'ae'e i luga o le ki e fa'aoso ai le popover. Mana'omia Tooltip e fa'aaofia.
E fa filifiliga o lo'o avanoa: luga, taumatau, pito i lalo, ma agavale fa'aoga.
Sed posuere consectetur est at lobortis. Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum.
Sed posuere consectetur est at lobortis. Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum.
Sed posuere consectetur est at lobortis. Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum.
Sed posuere consectetur est at lobortis. Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum.
Leai se fa'ailoga fa'aalia o popovers e fa'atupu mai le Javascript ma mea o lo'o i totonu o se data
uiga.
Fa'amalo popovers e ala i le JavaScript:
- $ ( '#fa'ata'ita'iga' ). popover ( filifiliga )
O filifiliga e mafai ona pasia e ala i faʻamatalaga uiga poʻo le JavaScript. Mo fa'amatalaga uiga, fa'aopoopo le igoa filifiliga i le data-
, pei o le data-animation=""
.
Igoa | ituaiga | faaletonu | fa'amatalaga |
---|---|---|---|
animation | boolean | moni | fa'aoga se suiga e mou atu css i le mea faigaluega |
html | boolean | pepelo | Fa'aofi le html i totonu o le popover. Afai e sese, o le a faʻaaogaina le text metotia a le jquery e faʻapipiʻi ai mea i totonu o le dom. Fa'aoga tusitusiga pe a e popole i osofa'iga a le XSS. |
tu'uga | manoa | galuega faatino | 'tauagavale' | fa'afefea ona fa'atulaga le popover - luga | lalo | agavale | tauagavale |
tagata filifilia | manoa | pepelo | afai e tu'uina atu se tagata filifilia, o meafaigāluega o le a tu'uina atu i fa'amoemoega fa'apitoa |
fa'aoso | manoa | 'kiliki' | pe fa'afefea ona fa'aoso popover - kiliki | lele | taula'i | tusi lesona |
suafa | manoa | galuega faatino | '' | fa'aigoa fa'aigoa pe a le o iai le uiga 'igoa' |
anotusi | manoa | galuega faatino | '' | le aoga o mea i totonu pe afai e le o iai le uiga o le 'data-content' |
tuai | numera | mea faitino | 0 | fa'atuai ona fa'aali ma nana le popover (ms) - e le fa'atatau ile fa'ailoga tusi tusi Afai e tu'uina atu se numera, fa'atuai e fa'aoga i natia/fa'aali uma O le fausaga o mea faitino o le: |
pusa | manoa | pepelo | pepelo | Fa'aopoopo le popover i se elemene patino |
Mo mafua'aga o fa'atinoga, o le Tooltip ma le Popover data-apis e tu'u i totonu. Afai e te mana'o e fa'aoga ia na'o le fa'atonuina o se filifiliga filifiliga.
E amata popovers mo se aoina elemene.
Fa'aalia se fa'apipi'i elemene.
- $ ( '#elemene' ). popover ( 'fa'aali' )
Natia se fa'apipi'i elemene.
- $ ( '#elemene' ). popover ( 'natia' )
Fa'asolo i luga o se elemene fa'apipi'i.
- $ ( '#elemene' ). popover ( 'toggle' )
Natia ma fa'aumatia le popover o se elemene.
- $ ( '#elemene' ). popover ( 'fa'aumatia' )
Fa'aopoopo galuega fa'ate'a i fe'au mataala uma i lenei fa'apipi'i.
Suia lea mea ma lena ma toe taumafai. Duis mollis, est non commodo luctus, nisi erat porttitor ligula, eget lacinia odio sem nec elit. Cras mattis consectetur purus sit amet fermentum.
Fa'aaga le fa'ate'aina o se mataala e ala i le JavaScript:
- $ ( ".alert" ). mataala ()
Na'o le fa'aopoopo data-dismiss="alert"
i lau ki tapuni e otometi ai ona tu'uina atu se fa'agaioiga vavalalata mataalia.
- <a vasega = "close" data-dismiss = "alert" href = "#" > &taimi; </a>
Ta'i fa'alilolilo uma fa'atasi ma fa'atinoga vavalalata. Ina ia fa'aoso au fa'ailo pe a tapuni, ia mautinoa o lo'o i ai le .fade
ma .in
le vasega ua uma ona fa'aoga ia i latou.
Tapuni se mataala.
- $ ( ".alert" ). mataala ( 'tapuni' )
O le vasega mataala a Bootstrap o lo'o fa'aalia ni nai mea na tutupu mo le fa'aogaina i galuega mataala.
Mea na tupu | Fa'amatalaga |
---|---|
tapunia | E mu vave lenei mea pe a close valaʻau le auala faʻataʻitaʻiga. |
tapuni | O lenei mea e tupu pe a tapunia le mataala (o le a faʻatali mo suiga css e maeʻa). |
- $ ( '#my-alert' ). fusifusia ( 'tapuni' , galuega () {
- // fai se mea...
- })
Maua sitaili faavae ma lagolago fetuutuunai mo vaega malepelepe pei o akordion ma le folauga.
* Manaomia le faʻapipiʻi Transitions e aofia ai.
I le faʻaaogaina o le paʻu faʻapipiʻi, na matou fausia ai se widget style accordion faigofie:
- <div class = "accordion" id = "accordion2" >
- <div class = "accordion-group" >
- <div class = "accordion-heading" >
- <a class = "accordion-toggle" data-toggle = "pa'ū" data-matua = "#accordion2" href = "#collapseOne" >
- Vaega #1
- </a>
- </div>
- <div id = "collapseOne" vasega = "accordion-body pa'ū i totonu" >
- <div class = "accordion-inner" >
- Anim pariatur cliche...
- </div>
- </div>
- </div>
- <div class = "accordion-group" >
- <div class = "accordion-heading" >
- <a vasega = "accordion-toggle" data-toggle = "pa'ū" data-matua = "#accordion2" href = "#collapseTwo" >
- Vaega #2
- </a>
- </div>
- <div id = "collapseTwo" class = "accordion-body collapse" >
- <div class = "accordion-inner" >
- Anim pariatur cliche...
- </div>
- </div>
- </div>
- </div>
- ...
E mafai foi ona e faʻaogaina le faʻapipiʻi e aunoa ma le faʻailoga accordion. Fai se faamau e sui ai le faalautele ma le pa'u o se isi elemene.
- <button type = "button" class = "btn btn-danger" data-toggle = "pa'ū" data-target = "#demo" >
- faigofie ona malepe
- </fa'amau>
- <div id = "demo" class = "pa'ū i totonu" > … </div>
Na'o le fa'aopoopo data-toggle="collapse"
ma le data-target
i le elemene e otometi ai ona tu'uina atu le fa'atonuga o se mea e mafai ona fa'apa'ia. E data-target
talia e le uiga le css filifili e fa'aoga le pa'u i. Ia mautinoa e faaopoopo le vasega collapse
i le elemene e mafai ona pa'u. Afai e te mana'o e le'i tatalaina, fa'aopoopo le vasega fa'aopoopo in
.
Ina ia fa'aopoopo le pulega vaega e pei o le accordion i se pule e mafai ona pa'u, fa'aopoopo le uiga fa'amaumauga data-parent="#selector"
. Va'ai i le demo e va'ai ai i lenei gaioiga.
Fa'aaga ma le lima ile:
- $ ( ".collapse" ). pa'u ()
O filifiliga e mafai ona pasia e ala i faʻamatalaga uiga poʻo le JavaScript. Mo fa'amatalaga uiga, fa'aopoopo le igoa filifiliga i le data-
, pei o le data-parent=""
.
Igoa | ituaiga | faaletonu | fa'amatalaga |
---|---|---|---|
matua | tagata filifilia | pepelo | Afai o le tagata filifilia, o le a tapunia uma elemene e mafai ona pa'u i lalo o le matua fa'amaonia pe a fa'aalia le mea e mafai ona fa'asolo. (e taitutusa ma amioga fa'aa'oa'oga masani) |
fesuia'i | boolean | moni | Fa'asolo le elemene e mafai ona pa'u i luga ole valaau |
Fa'aagaoioia lau anotusi o se elemene e mafai ona pa'u. Talia se filifiliga faitalia object
.
- $ ( '#myCollapsible' ). pa'u ({
- toggle : sese
- })
Su'e se elemene e mafai ona pa'u e fa'aali pe natia.
Fa'aalia se elemene e mafai ona pa'u.
Natia se elemene e mafai ona pa'u.
O le vasega pa'u a Bootstrap o lo'o fa'aalia ni nai mea na tutupu mo le fa'aogaina o galuega fa'aletonu.
Mea na tupu | Fa'amatalaga |
---|---|
fa'aali | E mu vave lenei mea pe a show valaʻau le auala faʻataʻitaʻiga. |
faaalia | O lenei mea e tupu pe a faʻaalia se elemene paʻu i le tagata faʻaoga (o le a faʻatali mo suiga css e maeʻa). |
lalafi | O lenei mea na tupu e faʻamalo vave pe a hide valaʻau le metotia. |
natia | O lenei mea e tupu pe a natia se elemene pa'ū mai le tagata faʻaoga (o le a faʻatali mo suiga css e maeʻa). |
- $ ( '#myCollapsible' ). i luga ( 'natia' , galuega () {
- // fai se mea...
- })
O le fa'ata'ita'iga o lo'o i lalo o lo'o fa'aalia ai se mea fa'apipi'i lautele ma se vaega mo le uila i elemene e pei o se carousel.
- <div id = "myCarousel" vasega = "carousel slide" >
- <ol class = "carousel-indicators" >
- <li data-target = "#myCarousel" data-slide-to = "0" class = "active" ></li>
- <li data-target = "#myCarousel" data-slide-to = "1" ></li>
- <li data-target = "#myCarousel" data-slide-to = "2" ></li>
- </ol>
- <!-- Carousel aitema -->
- <div class = "carousel-inner" >
- <div class = "mea aoga" > … </div>
- <div class = "aitema" > … </div>
- <div class = "aitema" > … </div>
- </div>
- <!-- Carousel nav -->
- <a vasega = "carousel-control left" href = "#myCarousel" data-slide = "mua" > ‹ </a>
- <a vasega = "carousel-control right" href = "#myCarousel" data-slide = "next" > › </a>
- </div>
Fa'aoga uiga fa'amaumauga e faigofie ai ona pulea le tulaga o le carousel. data-slide
talia upu autu prev
po'o le next
, lea e sui ai le tulaga fa'ase'e fa'atatau i lona tulaga o iai nei. I le isi itu, fa'aaoga data-slide-to
e pasi atu ai se fa'ailoga fa'ase'e mata i le carousel data-slide-to="2"
, lea e oso ai le tulaga fa'ase'e i se fa'ailoga patino e amata i le 0
.
Valaau ma le lima le carousel ma:
- $ ( '.carousel' ). carousel ()
O filifiliga e mafai ona pasia e ala i faʻamatalaga uiga poʻo JavaScriptz. Mo fa'amatalaga uiga, fa'aopoopo le igoa filifiliga i le data-
, pei o le data-interval=""
.
Igoa | ituaiga | faaletonu | fa'amatalaga |
---|---|---|---|
vaeluaga | numera | 5000 | Le aofa'i o le taimi e fa'atuai ai i le va o le ta'avale otometi se mea. Afai e sese, e le otometi le taamilomilo o le carousel. |
taofi | manoa | "faapepa" | Taofi le uila o le carousel i luga o le isumu ma toe faaauau le uila o le carousel i luga o le isumu. |
Fa'amataina le carousel i se filifiliga e filifili object
ma amata ai le uila i mea.
- $ ( '.carousel' ). carousel ({
- vaeluaga : 2000
- })
Taamilomilo i aitema carousel mai le agavale i le taumatau.
Taofi le carousel mai le tietie uila i aitema.
Ta'amilomilo le carousel i se fa'avaa fa'apitoa (fa'avae 0, tutusa ma se fa'asologa).
Ta'amilosaga i le mea muamua.
Ta'amilosaga i le isi mea.
O le vasega carousel a Bootstrap o lo'o fa'aalia ai mea e lua mo le fa'aogaina o galuega fa'aoga.
Mea na tupu | Fa'amatalaga |
---|---|
fa'ase'e | E mu vave lenei mea pe a fa'aogaina le slide auala fa'ata'ita'i. |
fa'ase'e | E fa'amu lenei mea pe a mae'a le fa'ase'esega fa'ase'e o le carousel. |
O se mea fa'apipi'i faigofie fa'alautele mo le vave faia o mataitusi mata'itusi ma so'o se fa'aoga tusitusiga.
- <input type = "text" data-provide = "typeahead" >
E te mana'o e fa'atulaga autocomplete="off"
e puipuia mai le fa'aalia o menus su'esu'e le fa'aalia i luga o le fa'aulu i lalo o le ta'itusi Bootstrap.
Fa'aopoopo uiga fa'amaumauga e fa'amauina ai se elemene ma le fa'aogaina o le mataitusi e pei ona fa'aalia i le fa'ata'ita'iga i luga.
Valaau ma le lima le mataitusi ma:
- $ ( '.typeahead' ). mataitusi ()
O filifiliga e mafai ona pasia e ala i faʻamatalaga uiga poʻo le JavaScript. Mo fa'amatalaga uiga, fa'aopoopo le igoa filifiliga i le data-
, pei o le data-source=""
.
Igoa | ituaiga | faaletonu | fa'amatalaga |
---|---|---|---|
puna | fa'asologa, galuega | [ ] | Le puna o fa'amatalaga e fesiligia. Atonu o se fa'asologa o manoa po'o se galuega. O le galuega e pasia ni finauga se lua, o le query tau i totonu o le fanua faʻaoga ma le process toe foʻi. E mafai ona fa'aoga fa'atasi le galuega e ala i le toe fa'afo'i sa'o mai o fa'amatalaga fa'amatalaga po'o le fa'atasi e ala i le process finauga e tasi a le callback. |
mea | numera | 8 | Le numera maualuga o mea e fa'aalia i le pa'ū. |
minUumi | numera | 1 | Ole umi ole amio e mana'omia a'o le'i fa'aosoina fautuaga fa'amae'a |
fa'atusa | galuega faatino | mata'upu e le maaleale | Le auala e fa'aaoga e iloa ai pe fetaui se fesili ma se mea. Talia se finauga e tasi, o le item tetee e su'e ai le fesili. Avanoa ile fesili o iai nei ile this.query . Fa'afo'i se boolean true pe afai o le fesili e fetaui. |
fa'avasega | galuega faatino | fetaui tonu, mata'upu mata'utia, mata'itusi le maaleale |
Metotia na fa'aaoga e fa'avasega ai fa'amae'a fa'amae'a. Talia se finauga e tasi items ma ei ai le lautele o le faʻataʻitaʻiga o le mataitusi. Fa'asino le fesili o iai nei ile this.query . |
fa'afouga | galuega faatino | toe faafoi mea filifilia | Le auala na faʻaaogaina e toe faʻafoʻi ai mea ua filifilia. Talia se finauga e tasi, o le item ma e iai le lautele o le fa'ata'ita'iga mataitusi. |
fa'ailoga | galuega faatino | fa'amanino uma fetauiga fa'aletonu | Metotia na fa'aaoga e fa'ailoa ai fa'ai'uga fa'amae'a. Talia se finauga e tasi item ma ei ai le lautele o le faʻataʻitaʻiga o le mataitusi. E tatau ona toe faafoi html. |
Fa'amataina se fa'aoga i se mataitusi.
O le subnavigation i le agavale o se faʻaaliga ola o le faʻapipiʻi faʻapipiʻi.
Ina ia faigofie ona faʻapipiʻi amioga i soʻo se elemene, naʻo le faʻaopoopo data-spy="affix"
i le elemene e te manaʻo e sipai ai. Ona fa'aoga lea o offsets e fa'amatala ai le taimi e sui ai le pine o se elemene i luga ma tape.
- <div data-spy = "affix" data-offset-top = "200" > ... </div>
affix
,
affix-top
, ma
affix-bottom
. Manatua e siaki se matua e ono pa'u pe a oso i totonu le fa'apipi'i a'o aveese mea mai le tafe masani o le itulau.
Valaau le affix plugin e ala i le JavaScript:
- $ ( '#navbar' ). fa'amau ()
O filifiliga e mafai ona pasia e ala i faʻamatalaga uiga poʻo le JavaScript. Mo fa'amatalaga uiga, fa'aopoopo le igoa filifiliga i le data-
, pei o le data-offset-top="200"
.
Igoa | ituaiga | faaletonu | fa'amatalaga |
---|---|---|---|
fa'apena | numera | galuega | mea faitino | 10 | Pixels e fa'asolo mai le lau pe a fa'atatau le tulaga o le ta'ai. Afai e tu'uina atu se numera tasi, o le a fa'aoga le offset i itu i luga ma agavale. Ina ia faʻalogo mo se faʻatonuga se tasi, poʻo le tele o faʻasalaga tulaga ese, naʻo le tuʻuina atu o se mea offset: { x: 10 } . Fa'aaoga se galuega pe a mana'omia le tu'uina atu ma le malosi o se offset (fa'aoga mo nisi fa'ata'ita'iga tali mai). |