Whakaorangia nga waahanga o Bootstrap—inaianei me nga taputapu jQuery ritenga 12 .
He ngawari, engari he ngawari, ka mau ki te mono javascript mod me te iti rawa o nga mahi me nga taunoa atamai.
Tāpirihia nga tahua takaiho ki nga mea katoa kei Bootstrap me tenei mono ngawari. Kei a Bootstrap te tautoko tahua takaiho ki runga i te pae whakatere, ripa, me nga pire.
Whakamahia te scrollspy ki te whakahou aunoa i nga hononga i to pae whakatere hei whakaatu i te hononga hohe o naianei i runga i te tuunga panuku.
Whakamahia tenei mono kia whai hua ake nga ripa me nga pire ma te tuku i a raatau ki te takahuri i roto i nga pihanga ripanga o nga ihirangi rohe.
He tirohanga hou mo te mono jQuery Tipsy, Karekau nga Aki Utauta e whakawhirinaki ki nga whakaahua—ka whakamahi ratou i te CSS3 mo nga pakiwaituhi me nga huanga-raraunga mo te rokiroki taitara o te rohe.
Tāpirihia nga whakakikorua iti o te ihirangi, penei i era i runga i te iPad, ki tetahi huānga mo nga korero tuarua mo te whare.
* Me whakauru nga aki taputapu
Ko te mono mataara he karaehe iti mo te taapiri i nga mahi tata ki nga matohi.
Mahi atu ki nga paatene. Ka kii te paatene mana, te hanga roopu patene ranei mo etahi atu waahanga penei i nga paeutauta.
Tikina nga momo turanga me te tautoko ngawari mo nga waahanga tiango penei i te accordions me te whakatere.
Waihangahia he kaupapa harikoa o nga mea katoa e hiahia ana koe ki te whakarato whakaatakiriata tauwhitiwhiti o te ihirangi.
He mono taketake, ngawari te whakaroa mo te hanga tere i nga momo upoko huatau me nga momo whakauru kuputuhi.
Mo nga paanga whakawhiti ngawari, whakaurua bootstrap-transition.js kotahi ki te paheke i roto i nga tikanga, ka memeha atu ranei nga matohi.
* E hiahiatia ana mo te hākoritanga i roto i nga monomai
He ngawari, engari he ngawari, ka mau ki te mono javascript mod me te iti rawa o nga mahi me nga taunoa atamai.
Tikiake kōnaeKei raro nei te ahua o te ahua o te ahua.
Kotahi te tinana pai…
Takahurihia he tikanga ma te javascript ma te paatene i te paatene kei raro nei. Ka paheke ki raro ka memeha mai i te tihi o te wharangi.
Whakarewahia te aratau demoKarangatia te tikanga ma te javascript:
- $ ( '#myModal' ). modal ( kōwhiringa )
Ingoa | momo | taunoa | whakaahuatanga |
---|---|---|---|
papamuri | boolean | pono | Kei roto he huānga tauira-papamuri. Arā, whakawhāitihia static he papamuri e kore e kati i te aratau i runga i te paatene. |
papapātuhi | boolean | pono | Ka kati i te aratau ina pehia te ki mawhiti |
whakaatu | boolean | pono | Ka whakaatu i te aratau ina arawhiti. |
Ka taea e koe te whakahohe i nga tikanga i runga i to wharangi ngawari me te kore e tuhi i tetahi rarangi javascript. Whakaturia noa ki data-toggle="modal"
runga i tetahi huānga kaiwhakahaere me te e rite ana data-target="#foo"
ranei href="#foo"
ki te id huānga aratau, a ka paohia, ka whakarewahia to aratau.
Ano, hei taapiri i nga whiringa ki to tauira aratau, whakauru noa hei huanga raraunga taapiri i runga i te huānga mana, i te tohu aratau ranei.
- <a class = "btn" data-toggle = "modal" href = "#myModal" > Whakarewa Modal </a>
- <div class = "tauira huna" id = "myModal" >
- <div class = "modal-header" >
- <button type = "button" class = "close" data-dismiss = "modal" > × </button>
- <h3> pane pane </h3>
- </div>
- <div class = "modal-body" >
- <p> Kotahi te tinana pai… </p>
- </div>
- <div class = "modal-footer" >
- <a href = "#" class = "btn" data-dismiss = "modal" > Katia </a>
- <a href = "#" class = "btn btn-primary" > Tiakina nga huringa </a>
- </div>
- </div>
.fade
karaehe ki te
.modal
huānga (tirohia te demo ki te kite i tenei mahi) me te whakauru bootstrap-transition.js.
Whakahohehia to ihirangi hei aratau. Ka whakaae ki nga whiringa whiriwhiri object
.
- $ ( '#myModal' ). tikanga ({
- papapātuhi : teka
- })
Ka takahuri-a-ringa i te tikanga.
- $ ( '#myModal' ). modal ( 'takahuri' )
Ka whakatuwhera a-ringa i te tikanga.
- $ ( '#myModal' ). modal ( 'whakaatu' )
Ka huna a-ringa i tetahi tikanga.
- $ ( '#myModal' ). modal ( 'huna' )
Ko te karaehe aratau a Bootstrap e whakaatu ana i etahi huihuinga mo te hono atu ki nga mahi tikanga.
Takahanga | Whakaahuatanga |
---|---|
whakaatu | Ka pupuhi tenei takahanga ina ka show karangahia te aratuka tauira. |
whakaaturia | Ka puhia tenei takahanga i te wa i kitea ai te aratau ki te kaiwhakamahi (ka tatari kia oti nga whakawhitinga css). |
huna | Ka puhia tonutia tenei takahanga ina hide kua karangahia te aratuka tauira. |
huna | Ka puhia tenei takahanga ina mutu te hunanga o te tikanga mai i te kaiwhakamahi (ka tatari kia oti nga whakawhitinga css). |
- $ ( '#myModal' ). kei runga ( 'huna' , mahi () {
- // mahia tetahi mea…
- })
Tāpirihia nga tahua takaiho ki nga mea katoa kei Bootstrap me tenei mono ngawari. Kei a Bootstrap te tautoko tahua takaiho ki runga i te pae whakatere, ripa, me nga pire.
Tikiake kōnaePaatohia nga hononga whakaterenga iho i te pae whakatere me nga pire kei raro nei hei whakamatautau i nga takaiho.
Karangatia nga takaiho ma te javascript:
- $ ( '.dropdown-toggle' ). takaiho ()
Kia tere te taapiri i nga mahi takaiho ki tetahi huānga me tapiri noa data-toggle="dropdown"
ka whakahohe aunoa i nga takahanga bootstrap whaimana.
data-target="#fat"
ranei
href="#fat"
.
- <ul class = "nav nav-pills" >
- <li class = "active" ><a href = "#" > Hononga auau </a> </li>
- <li class = "dropdown" id = "menu1" >
- <a class = "whakataka-takahuri" data-toggle = "whakaheke" href = "#menu1" >
- Whakataka iho
- <b class = "caret" ></b>
- </a>
- <ul class = "tahua-whakaheke" >
- <li><a href = "#" > Mahi </a> </li>
- <li><a href = "#" > He mahi ano </a></li>
- <li><a href = "#" > He mea ano kei konei </a></li>
- <li class = "kaiwehewehe" ></li>
- <li><a href = "#" > Hononga wehea </a> </li>
- </ul>
- </li>
- ...
- </ul>
Kia mau tonu nga URL, whakamahia te data-target
huanga hei utu href="#"
.
- <ul class = "nav nav-pills" >
- <li class = "whakaheke" >
- <a class = "whakataka-takahuri" data-toggle = "whakaheke" data-target = "#" href = "ara/ki/page.html" >
- Whakataka iho
- <b class = "caret" ></b>
- </a>
- <ul class = "tahua-whakaheke" >
- ...
- </ul>
- </li>
- </ul>
He api pataka mo te whakahohe i nga tahua mo te pae whakaterenga kua tohua, te whakatere ripa ranei.
Ko te mono ScrollSpy mo te whakahou aunoa i nga whaainga nav i runga i te tuunga panuku.
Tikiake kōnaePanuku te waahi i raro nei ka matakitaki i te whakahou whakaterenga. Ka miramirahia nga mea iti takaiho. Whakamātauria!
Ad leggings keytar, brunch id toi party dolor laboure. Pitchfork yr enim lo-fi i mua i to ratou hoko atu. Tumblr pāmu-ki-tepu mana pahikara ahakoa. Anim keffiyeh carles cardigan. Velit seitan mcsweeney's photo booth 3 wolf moon irure. Ko nga tarau tarau jean koti, williamsburg hoodie minim qui kaore pea koe i rongo mo ena me te cardigan trust fund culpa biodiesel wes anderson aesthetic. Nihil tattooed accusamus, cred irony biodiesel keffiyeh artistan ullamco consequat.
Veniam marfa mustache papareti, adipisicing fugiat velit pitchfork pahau. Freegan pahau aliqua cupidatat mcsweeney's vero. Cupidatat wha loko nisi, ea helvetica nulla carles. Taraka kai taraka kai moko, ko te quis non freegan vinyl a mcsweeney. 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. Te mana paihikara Lomo 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. Ko te Vero VHS he tino pai. Consectetur etahi DIY iti putea karere. Ko te whakaaro o mua i roto i te, tauwhiro 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 ahakoa he taraka kai. Sapiente synth id assumenda. Locavore sed helvetica cliche irony, thundercats kaore pea koe i rongo mo ratou e consequat hoodie gluten-free lo-fi fap aliquip. Whakamahia he waahi i mua i te hokonga atu, ko terry richardson proident brunch nesciunt quis cosby sweater pariatur keffiyeh ut helvetica artistan. Cardigan craft beer seitan readymade velit. VHS chambray laboris tempor veniam. Anim mollit minim commodo ullamco thundercats.
Karangatia te scrollspy mā te javascript:
- $ ( '#navbar' ). scrollspy ()
Kia ngawari te taapiri i te whanonga scrollspy ki to whakatere pae runga, taapiri noa data-spy="scroll"
ki te huānga e hiahia ana koe ki te tutei (te nuinga ko te tinana tenei).
- <body data-spy = "panuku" > ... </body>
<a href="#home">home</a>
me rite ki tetahi mea i roto i te dom rite
<div id="home"></div>
.
Ina whakamahi i te scrollspy me te taapiri, te tango ranei i nga huānga mai i te DOM, me waea koe ki te tikanga whakahou penei:
- $ ( '[data-spy="scroll"]' ). ia ( mahi () {
- var $spy = $ ( tenei ). scrollspy ( 'whakahou' )
- });
Ingoa | momo | taunoa | whakaahuatanga |
---|---|---|---|
whakatiki | tau | 10 | Pika hei whakatiki mai i runga i te tatau i te waahi o te panuku. |
Takahanga | Whakaahuatanga |
---|---|
whakahohe | Ka pupuhi tenei takahanga i nga wa katoa ka whakahohehia he mea hou e te scrollspy. |
Ka taapirihia e tenei mono he ripa tere, hihiri me te mahi pire mo te whakawhiti i roto i nga ihirangi o te rohe.
Tikiake kōnaePatohia nga ripa i raro nei hei takahuri i waenga i nga pihanga huna, ahakoa ma nga tahua takaiho.
Kare pea koe i rongo ki a ratou he tarau jean Austin. Nesciunt tofu stumptown aliqua, retro synth master horoi. Moutere cliche tempor, williamsburg carles vegan helvetica. Reprehenderit butcher retro keffiyeh dreamcatcher synth. Cosby sweater eu banh mi, qui irure terry richardson ex wheke. A tuu i te salvia cillum iphone. Seitan aliquip quis cardigan kakahu a Amerika, te kai patu patu i etahi 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 wheke scenester freegan cosby sweater. Fanny pack portland seitan DIY, toi party locavore wolf cliche high life echo park Austin. Cred vinyl keffiyeh DIY salvia PBR, banh mi i mua i ta ratou hoko atu i te paamu-ki-tepu VHS viral locavore cosby sweater. Lomo wolf viral, ngutu readymade thundercats keffiyeh craft beer marfa matatika. Wolf salvia freegan, sartorial keffiyeh echo park vegan.
Whakahohehia nga ripa ripa ma te javascript (me whakahohe takitahi ia ripa):
- $ ( '#myTab a' ). pawhiria ( mahi ( e ) {
- e . āraiTaunoa ();
- $ ( tenei ). ripa ( 'whakaatu' );
- })
Ka taea e koe te whakahohe i nga ripa takitahi i roto i nga huarahi maha:
- $ ( '#myTab a[href="#profile"]' ). ripa ( 'whakaatu' ); // Tīpakohia te ripa mā te ingoa
- $ ( '#myTab a:tuatahi' ). ripa ( 'whakaatu' ); // Tīpakohia te ripa tuatahi
- $ ( '#myTab a: last' ). ripa ( 'whakaatu' ); // Tīpakohia te ripa whakamutunga
- $ ( '#myTab li:eq(2) a' ). ripa ( 'whakaatu' ); // Tīpakohia te ripa tuatoru (0-taupū)
Ka taea e koe te whakahohe i te ripa, i te whakatere pire ranei me te kore e tuhi i tetahi tuhinga javascript ma te tohu noa , i runga data-toggle="tab"
ranei data-toggle="pill"
i tetahi huānga. Ko te taapiri i nga karaehe nav
me nav-tabs
nga karaehe ki te ripa ul
ka uru ki te whakaahua ripa bootstrap.
- <ul class = "nav nav-ripa" >
- <li><a href = "#home" data-toggle = "tab" > Home </a> </li>
- <li><a href = "#profile" data-toggle = "ripa" > Kōtaha </a> </li>
- <li><a href = "#messages" data-toggle = "ripa" > Karere </a> </li>
- <li><a href = "#settings" data-toggle = "ripa" > Tautuhinga </a> </li>
- </ul>
Ka whakahohe i te huānga ripa me te ipu ihirangi. Me whai Ripa he data-target
, he href
kohanga ipu ranei kei roto i te DOM.
- <ul class = "nav nav-tabs" id = "myTab" >
- <li class = "active" ><a href = "#home" > Home </a> </li>
- <li><a href = "#profile" > Kōtaha </a> </li>
- <li><a href = "#karere" > Nga Karere </a> </li>
- <li><a href = "#settings" > Tautuhinga </a> </li>
- </ul>
- <div class = "ripa-ihirangi" >
- <div class = "tab-pane active" id = "home" > ... </div>
- <div class = "tab-pane" id = "profile" > ... </div>
- <div class = "tab-pane" id = "nga karere" > ... </div>
- <div class = "tab-pane" id = "tautuhinga" > ... </div>
- </div>
- <hōtuhi>
- $ ( mahi () {
- $ ( '#myTab a: last' ). ripa ( 'whakaatu' );
- })
- </script>
Takahanga | Whakaahuatanga |
---|---|
whakaatu | Ka pupuhi tenei takahanga ki te whakaaturanga ripa, engari i mua i te whakaaturanga o te ripa hou. Whakamahia event.target me event.relatedTarget te aro ki te ripa hohe me te ripa hohe o mua (mehemea e waatea ana). |
whakaaturia | Ka ahi tenei takahanga ki te whakaaturanga ripa i muri i te whakaaturanga ripa. Whakamahia event.target me event.relatedTarget te aro ki te ripa hohe me te ripa hohe o mua (mehemea e waatea ana). |
- $ ( 'a[data-toggle="ripa"]' ). kei runga ( 'whakaatuhia' , mahi ( e ) {
- e . ūnga // ripa whakahohe
- e . relatedTarget // ripa o mua
- })
I whakaaweahia e te mono jQuery.tipsy pai i tuhia e Jason Frame; Ko nga aki-utauta he putanga whakahou, kaore e whakawhirinaki ki nga whakaahua, whakamahi css3 mo nga pakiwaituhi, me nga huanga-raraunga mo te rokiroki taitara rohe.
Tikiake kōnaeWhakaparo ki runga i nga hononga i raro nei kia kite i nga aki taputapu:
Ko nga tarau tarau karekau pea koe i rongo. Pua whakaahua pahau denim mata reta vegan putea karere stumptown. Ko te quinoa 8-bit te kakahu o Amerika he terry richardson's fixie a mcsweeney's fixie te kakahu o Amerika he terry richardson vinyl chambray. Beard stumptown, cardigans banh mi lomo thundercats. Tofu biodiesel williamsburg marfa, e wha te purenga vegan chambray a loko mcsweeney. He tohunga toi tino whakahiato ahakoa te keytar , scenester farm-to-table banksy Austin twitter handle freegan cred raw denim single-origin coffee viral.
Whakaohohia te aki taputapu ma te javascript:
- $ ( '#tauira' ). aki taputapu ( kōwhiringa )
Ingoa | momo | taunoa | whakaahuatanga |
---|---|---|---|
hākoritanga | boolean | pono | hoatu he whakawhiti memeha css ki te aki taputapu |
whakanohonga | aho|mahi | 'runga' | me pehea te whakanoho i te aki taputapu - runga | raro | maui | tika |
kaiwhiriwhiri | aho | teka | Mena ka tukuna he kaiwhiriwhiri, ka tukuna nga taonga aki taputapu ki nga whaainga kua tohua. |
taitara | aho | mahi | '' | uara taitara taunoa mena karekau he tohu `taitara` |
keu | aho | 'whakapapa' | me pehea te whakakorikori i te aki taputapu - whakaparo | arotahi | ā-ringa |
whakaroa | tau | ahanoa | 0 | whakaroa te whakaatu me te huna i te aki taputapu (ms) - kaore e pa ki te momo keu a-ringa Mena ka tukuna he nama, ka tukuna he whakaroa ki te huna/whakakitenga e rua Ko te hanganga ahanoa: |
Mo nga take mahi, ka uru mai te Aki Utauta me te Popover data-apis. Mena kei te pirangi koe ki te whakamahi, tohua he kowhiringa kaiwhiriwhiri.
- <a href = "#" rel = "Aki taputapu" title = "Aki taputapu tuatahi" > whakaparo ki runga i ahau </a>
Ka taapirihia he kaihautu taputapu ki tetahi kohinga huānga.
He whakaatu i te aki taputapu o tetahi huānga.
- $ ( '#huānga' ). aki taputapu ( 'whakaatu' )
Hunaia te aki taputapu o tetahi huānga.
- $ ( '#huānga' ). aki taputapu ( 'huna' )
Ka takahurihia te akiutauta o tetahi huānga.
- $ ( '#huānga' ). aki taputapu ( 'takahuri' )
Tāpirihia nga whakakikorua iti o te ihirangi, penei i era i runga i te iPad, ki tetahi huānga mo nga korero tuarua mo te whare.
* Me whakauru aki taputapu
Tikiake kōnaeWhakaparo ki runga i te paatene hei whakaoho i te pouver.
Whakahohehia nga popovers ma te javascript:
- $ ( '#tauira' ). popover ( kōwhiringa )
Ingoa | momo | taunoa | whakaahuatanga |
---|---|---|---|
hākoritanga | boolean | pono | hoatu he whakawhiti memeha css ki te aki taputapu |
whakanohonga | aho|mahi | 'tika' | me pehea te whakanoho i te pouver - runga | raro | maui | tika |
kaiwhiriwhiri | aho | teka | ki te tukuna he kaiwhiriwhiri, ka tukuna nga taonga taputapu ki nga whaainga kua tohua |
keu | aho | 'whakapapa' | me pehea te whakakorikori i te aki taputapu - whakaparo | arotahi | ā-ringa |
taitara | aho | mahi | '' | uara taitara taunoa mena karekau te huanga `taitara` |
ihirangi | aho | mahi | '' | uara ihirangi taunoa ki te kore te huanga `raraunga-ihirangi` |
whakaroa | tau | ahanoa | 0 | whakaroa te whakaatu me te huna i te popover (ms) - kaore e pa ki te momo keu a-ringa Mena ka tukuna he nama, ka tukuna he whakaroa ki te huna/whakakitenga e rua Ko te hanganga ahanoa: |
Mo nga take mahi, ka uru mai te Aki Utauta me te Popover data-apis. Mena kei te pirangi koe ki te whakamahi, tohua he kowhiringa kaiwhiriwhiri.
Ka arataki popover mo te kohinga huānga.
He whakaatu i tetahi huānga popover.
- $ ( '#huānga' ). popover ( 'whakaatu' )
Hunaia he huānga popover.
- $ ( '#huānga' ). popover ( 'huna' )
Ka takahuri i tetahi huānga popover.
- $ ( '#huānga' ). popover ( 'takahuri' )
Ko te mono mataara he karaehe iti mo te taapiri i nga mahi tata ki nga matohi.
TikiakeKa mahi te mono matohi i runga i nga karere matohi auau, me te aukati i nga karere.
Hurihia tenei me tera ka ngana ano. Duis mollis, est non commodo luctus, nisi erat porttitor ligula, eget lacinia odio sem nec elit. Cras mattis consectetur purus sit amet fermentum.
Whakahohehia te whakakore i te matohi ma te javascript:
- $ ( ".matohi" ). mataara ()
Taapiri noa data-dismiss="alert"
ki to patene kati hei hoatu aunoa i te mahi kati matohi.
- <a class = "kati" data-dismiss = "matohi" href = "#" > × </a>
Ka takai i nga matohi katoa me te mahi tata. Kia whakakorikorihia o matohi ina katia, me mohio kei a raatau te karaehe .fade
me .in
te karaehe kua tukuna ki a raatau.
Katia he matohi.
- $ ( ".matohi" ). mataara ( 'kati' )
Ko te karaehe mataara a Bootstrap e whakaatu ana i etahi huihuinga mo te hono ki te mahi mataara.
Takahanga | Whakaahuatanga |
---|---|
kati | Ka pupuhi tenei takahanga ina ka close karangahia te aratuka tauira. |
katia | Ka puhia tenei takahanga ina katia te matohi (ka tatari kia oti nga whakawhitinga css). |
- $ ( '#taku-matohi' ). herea ( 'katia' , mahi () {
- // mahia tetahi mea…
- })
Tikina nga momo turanga me te tautoko ngawari mo nga waahanga tiango penei i te accordions me te whakatere.
Tikiake kōnae* Me whakauru te mono Whakawhiti.
Ma te whakamahi i te mono tiango, i hangaia e matou he widget ahua accordion ngawari:
Whakahohe ma te javascript:
- $ ( ".collapse" ). tiango ()
Ingoa | momo | taunoa | whakaahuatanga |
---|---|---|---|
matua | kaiwhiriwhiri | teka | Ki te kaikowhiri ka kati nga huānga tiango katoa i raro i te matua kua tohua ina whakaatuhia tenei mea tiango. (he rite ki te whanonga akoriona tuku iho) |
takahuri | boolean | pono | Ka takahuri i te huānga tiango i runga i te inoi |
Tāpiri noa data-toggle="collapse"
me te data-target
ki te huānga ki te tautapa aunoa i te mana o te huānga tiango. Ka data-target
whakaaetia e te huanga he kaikowhiri css hei hoatu i te tiango ki. Me tino taapiri te karaehe collapse
ki te huānga tiango. Mena kei te pirangi koe kia tuwhera taunoa, taapirihia te akomanga taapiri in
.
- <button class = "btn btn-danger" data-toggle = "tiango" raraunga-target = "#demo" >
- ngawari te tiango
- </pātene>
- <div id = "demo" class = "collapse in" > … </div>
data-parent="#selector"
. Tirohia te demo kia kite i tenei mahi.
Ka whakahohe i to ihirangi hei huānga tiango. Ka whakaae ki nga whiringa whiriwhiri object
.
- $ ( '#myCollapsible' ). tiango ({
- takahuri : teka
- })
Ka takahuri i tetahi huānga tiango hei whakaatu, huna ranei.
Ka whakaatu i tetahi huānga tiango.
Hunaia he huānga tiango.
Ko te karaehe tiango a Bootstrap e whakaatu ana i etahi huihuinga mo te hono ki te mahi tiango.
Takahanga | Whakaahuatanga |
---|---|
whakaatu | Ka pupuhi tenei takahanga ina ka show karangahia te aratuka tauira. |
whakaaturia | Ka puhia tenei takahanga ina kitea he huānga tiango ki te kaiwhakamahi (ka tatari kia oti nga whakawhitinga css). |
huna | Ka pupuhihia tenei kaupapa i te wa hide i kiia ai te tikanga. |
huna | Ka puhia tenei takahanga ina hunahia he huānga tiango mai i te kaiwhakamahi (ka tatari kia oti nga whakawhitinga css). |
- $ ( '#myCollapsible' ). kei runga ( 'huna' , mahi () {
- // mahia tetahi mea…
- })
Tirohia te whakaatakiriata i raro nei.
Waea ma javascript:
- $ ( '.carousel' ). carousel ()
Ingoa | momo | taunoa | whakaahuatanga |
---|---|---|---|
wā | tau | 5000 | Te nui o te wa ki te whakaroa i waenga i te paihikara aunoa i tetahi mea. Mena he teka, e kore e huri aunoa a carousel. |
okioki | aho | "whakapapa" | Ka whakataa te paihikara o te carousel i runga i te kiore, ka timata ano te paihikara o te carousel i runga i te kiore. |
Ka whakamahia nga huanga raraunga mo nga mana o mua me muri. Tirohia te tauira tohu i raro nei.
- <div id = "myCarousel" class = "carousel slide" >
- <!-- Tuemi Carousel -->
- <div class = "carousel-roto" >
- <div class = "tuemi hohe" > … </div>
- <div class = "tuemi" > … </div>
- <div class = "tuemi" > … </div>
- </div>
- <!-- Carousel nav -->
- <a class = "carousel-control left" href = "#myCarousel" data-slide = "mua" > ‹ </a>
- <a class = "carousel-control right" href = "#myCarousel" data-slide = "muri" > › </a>
- </div>
Ka arataki i te carousel me etahi whiringa object
ka tiimata ka timata te paihikara i roto i nga taonga.
- $ ( '.carousel' ). carousel ({
- wā : 2000
- })
Ka huri i nga taonga carousel mai i te maui ki te matau.
Ka aukati te carousel i te eke paihikara ma nga taonga.
Ka huri i te carousel ki tetahi anga (0 te ahua, he rite ki te huranga).
Ka huri ki te mea o mua.
Ka huri ki te tuemi e whai ake nei.
Ko te karaehe carousel a Bootstrap e whakaatu ana i nga huihuinga e rua mo te hono ki te mahi carousel.
Takahanga | Whakaahuatanga |
---|---|
kiriata | Ka puhipuhi tonu tenei takahanga ina ka tonohia te slide aratuka tauira. |
paheke | Ka pupuhihia tenei takahanga ina oti ana te carousel i tana whakawhiti kiriata. |
He mono taketake, ngawari te whakaroa mo te hanga tere i nga momo upoko huatau me nga momo whakauru kuputuhi.
Tikiake kōnaeTīmatahia te pato i te āpure i raro nei hei whakaatu i ngā hua o te upoko patopato.
Karangatia te upoko tuhi ma te javascript:
- $ ( '.typeahead' ). upoko patopato ()
Ingoa | momo | taunoa | whakaahuatanga |
---|---|---|---|
puna | huinga | [ ] | Ko te puna raraunga hei patai. |
tūemi | tau | 8 | Ko te maha o nga taonga hei whakaatu i te takaiho. |
kaiwhakariterite | mahi | take koretake | Ko te tikanga e whakamahia ana hei whakatau mena ka taurite tetahi patai ki tetahi mea. Ka whakaae ki te tohenga kotahi, ko te item mea hei whakamatautau i te patai. Uru ki te uiui onāianei me te this.query . Whakahokia he boolean true mena he taurite te patai. |
kaihoroi | mahi | ōrite tika, take tairongo, take tairongo |
Tikanga i whakamahia hei kōmaka i nga hua whakaoti aunoa. Ka whakaae ki te tohenga kotahi items , a, kei a ia te whānuitanga o te tauira o te upoko patopato. Tohutoro te patai onāianei me te this.query . |
miramira | mahi | e whakaatu ana i nga whakataetae taunoa katoa | Tikanga hei whakanui i nga hua whakaoti-aunoa. Ka whakaae ki te tohenga kotahi item , a, kei a ia te whānuitanga o te tauira o te upoko patopato. Me whakahoki html. |
Taapirihia nga huanga raraunga hei rehita i tetahi huānga me te taumahinga momotuhi.
- < momo whakauru = "kuputuhi" raraunga-provide = "typeahead" >
Ka arataki i te whakaurunga me te upoko patopato.