Hunza zvinhu zveBootstrap kuhupenyu-ikozvino ne13 tsika jQuery plugins.
Mapulagi anogona kuverengerwa ega (kunyangwe mamwe akada zvinoenderana), kana zvese kamwechete. Ose ari maviri bootstrap.js uye bootstrap.min.js ane ese maplugins mufaira rimwe chete.
Unogona kushandisa ese Bootstrap plugins chete kuburikidza neiyo markup API pasina kunyora mutsara mumwechete weJavaScript. Iyi ndiyo Bootstrap yekutanga kirasi API uye inofanirwa kuve yako yekutanga kufunga kana uchishandisa plugin.
Izvozvo zvakati, mune mamwe mamiriro ezvinhu zvingave zvinodiwa kudzima basa iri. Naizvozvo, isu tinopawo kugona kudzima iyo data attribute API nekusunungura zvese zviitiko pane body namespaced ne `'data-api'`. Izvi zvinotaridzika seizvi:
- $ ( 'muviri' ). kudzimwa ( '.data-api' )
Neimwe nzira, kunanga imwe plugin, ingo sanganisira zita replugin sezita rezita pamwe chete nedata-api namespace seizvi:
- $ ( 'muviri' ). kudzima ( '.alert.data-api' )
Isu tinotenda zvakare kuti unofanirwa kukwanisa kushandisa ese Bootstrap plugins kuburikidza neJavaScript API. MaAPI ese eruzhinji inzira imwechete, inobatika, uye inodzosa kuunganidzwa kwaitwa.
- $ ( ".btn.danger" ). bhatani ( "toggle" ). addClass ( "mafuta" )
Nzira dzese dzinofanirwa kugamuchira chinhu chekusarudza sarudzo, tambo inonangana neimwe nzira, kana hapana (iyo inotanga plugin ine default maitiro):
- $ ( "#myModal" ). modal () // yakatanga nema defaults
- $ ( "#myModal" ). modal ({ keyboard : false }) // yakatanga isina kiibhodhi
- $ ( "#myModal" ). modal ( 'show' ) // inotanga uye invokes kuratidza pakarepo
Imwe neimwe plugin zvakare inofumura mugadziri wayo mbishi pane `Constructor` pfuma: $.fn.popover.Constructor
. Kana iwe uchida kuwana imwe plugin muenzaniso, itore zvakananga kubva kune chinhu: $('[rel=popover]').data('popover')
.
Dzimwe nguva zvinodikanwa kushandisa Bootstrap plugins nemamwe maUI maficha. Mumamiriro ezvinhu aya, kudhumhana kwemazita kunogona kuitika dzimwe nguva. Kana izvi zvikaitika, unogona kufonera .noConflict
plugin yaunoda kudzorera kukosha kwayo.
- var bootstrapButton = $ . fn . bhatani . noConflict () // dzorera $.fn.button kune yakambopiwa kukosha
- $ . fn . bootstrapBtn = bootstrapButton // ipa $() .bootstrapBtn basa rebootstrap
Bootstrap inopa zviitiko zvetsika kune akawanda plugin akasarudzika zviito. Kazhinji, izvi zvinouya muchimiro chechirevo chisingaperi uye chekare - apo chisingaperi (ex. show
) chinotangwa pakutanga kwechiitiko, uye chimiro chayo chekare (ex. shown
) chinokonzeresa pakupedzwa kwechiito.
Zvese zvisingaperi zviitiko zvinopa kudziviriraDefault kushanda. Izvi zvinopa kugona kumisa kuitwa kwechiito chisati chatanga.
- $ ( '#myModal' ). pa ( 'show' , basa ( e ) {
- kana (! data ) dzoka e . kudziviriraDefault () // inomisa modal kubva kuratidzwa
- })
Kuti uite shanduko iri nyore, sanganisira bootstrap-transition.js kamwe padivi pemamwe mafaera eJS. Kana uri kushandisa compiled (kana minified) bootstrap.js , hapana chikonzero chekuisa izvi-zvatovepo.
Mienzaniso mishoma yeshanduko plugin:
Modals inogadziridzwa, asi inoshanduka, dialog inokurudzira ine hushoma hunodiwa mashandiro uye smart defaults.
A revered modal ine musoro, muviri, uye seti yezviito munyasi.
Muviri wakanaka…
- <div class = "modal hide fade" >
- <div kirasi = "modal-header" >
- <button type = "button" class = "close" data-dismiss = "modal" aria-hidden = "true" > × </ button>
- <h3> Modal musoro </h3>
- </ div>
- <div kirasi = "modal-muviri" >
- <p> Muviri mumwe wakanaka… </p>
- </ div>
- <div kirasi = "modal-footer" >
- <a href = "#" class = "btn"> Vhara </a> _
- <a href = "#" class = "btn btn-primary"> Chevha shanduko </a>
- </ div>
- </ div>
Shandura modal kuburikidza neJavaScript nekudzvanya bhatani riri pazasi. Ichatsvedza pasi uye kupera mukati kubva kumusoro kwepeji.
- <!-- Bhatani rekutanga modal -->
- <a href = "#myModal" role = "button" class = "btn" data-toggle = "modal"> Tangisa demo modal </a>
- <!-- Modal -->
- <div id = "myModal" class = "modal hide fade" tabindex = "-1" role = "dialog" aria-labelledby = "myModalLabel" aria-hidden = "chokwadi" >
- <div kirasi = "modal-header" >
- <button type = "button" class = "close" data-dismiss = "modal" aria-hidden = "true" > × </button>
- <h3 id = "myModalLabel" > Modal musoro </h3>
- </ div>
- <div kirasi = "modal-muviri" >
- <p> Muviri mumwe wakanaka… </p>
- </ div>
- <div kirasi = "modal-footer" >
- <button class = "btn" data-dismiss = "modal" aria-hidden = "true" > Vhara </button>
- <button class = "btn btn-primary" > Chengetedza shanduko </button>
- </ div>
- </ div>
Shandisa modal pasina kunyora JavaScript. Gadzirisa data-toggle="modal"
chinhu chekutonga, sebhatani, pamwe chete nea data-target="#foo"
kana href="#foo"
kunanga imwe modhi yekushandura.
- <button type = "bhatani" data-toggle = "modal" data-target = "#myModal" > Tanga modal </button>
Fonera modal ine id myModal
ine mutsara mumwechete weJavaScript:
- $ ( '#myModal' ). modal ( sarudzo )
Sarudzo dzinogona kupfuudzwa kuburikidza nedata hunhu kana JavaScript. Nezve data hunhu, wedzera iyo sarudzo zita ku data-
, semu data-backdrop=""
.
Zita | type | default | tsananguro |
---|---|---|---|
kumashure | boolean | chokwadi | Inosanganisira modal-backdrop element. Neimwe nzira, tsanangura static kune yekumashure iyo isingavhare modal pakudzvanya. |
keyboard | boolean | chokwadi | Inovhara modal kana kiyi yekutiza ikadzvanywa |
show | boolean | chokwadi | Inoratidza modal kana yatangwa. |
kure | nzira | nhema | Kana url iri kure ikapihwa, zvirimo zvinoiswa kuburikidza nejQuery's
|
Inomisa zvirimo zvako se modal. Inobvuma sarudzo dzaungada object
.
- $ ( '#myModal' ). modhi ({
- keyboard : nhema
- })
Pamaoko anoshandura modal.
- $ ( '#myModal' ). modal ( 'toggle' )
Nemaoko anovhura modal.
- $ ( '#myModal' ). modal ( 'show' )
Anozvivanza modal.
- $ ( '#myModal' ). modal ( 'hide' )
Bootstrap's modal kirasi inofumura zviitiko zvishoma zvekukochekera kuita modal mashandiro.
Chiitiko | Tsanangudzo |
---|---|
show | Ichi chiitiko chinopisa nekukasira kana show nzira yemuenzaniso inodanwa. |
kuratidzwa | Ichi chiitiko chinodzingwa kana modal yaitwa kuti ionekwe kumushandisi (inomirira kuti css shanduko ipedze). |
hide | Ichi chiitiko chinodzingwa nekukasira kana iyo hide muenzaniso nzira yadaidzwa. |
zvakavanzika | Ichi chiitiko chinodzingwa kana modal yapedza kuvanzwa kubva kumushandisi (inomirira css shanduko kuti ipedze). |
- $ ( '#myModal' ). pa ( 'zvakavanzika' , basa () {
- // ita chimwe chinhu…
- })
Wedzera mamenu ekudonha kune chero chinhu neiyi plugin iri nyore, kusanganisira iyo navbar, ma tabo, uye mapiritsi.
Wedzera data-toggle="dropdown"
kune chinongedzo kana bhatani kuti uchinje kudonhedza pasi.
- <div kirasi = "kudonha" >
- <a class = "dropdown-toggle" data-toggle = "dropdown" href = "#" > Dropdown trigger </a>
- <ul class = "dropdown-menu" role = "menu" aria-labelledby = "dLabel" >
- ...
- </ul>
- </ div>
Kuti uchengetedze maURL akasimba, shandisa data-target
hunhu pachinzvimbo che href="#"
.
- <div kirasi = "kudonha" >
- <a class = "dropdown-toggle" id = "dLabel" role = "button" data-toggle = "dropdown" data-target = "#" href = "/page.html" >
- Dropdown
- <b class = "caret" ></b>
- </a>
- <ul class = "dropdown-menu" role = "menu" aria-labelledby = "dLabel" >
- ...
- </ul>
- </ div>
Fonera zvinodonha kuburikidza neJavaScript:
- $ ( '.dropdown-toggle' ). kudonha ()
Hapana
Iyo programmatic api yekushandura menyu kune yakapihwa navbar kana tabbed navigation.
Iyo ScrollSpy plugin ndeyekugadzirisa otomatiki zvinangwa zve nav zvichienderana nenzvimbo yekupumburudza. Skrodza nzvimbo iri pazasi pebhari uye tarisa iyo inoshanda kirasi shanduko. Izvo zvinodonhedza sub zvinhu zvicharatidzwa zvakare.
Ad leggings keytar, brunch id art party dolor labore. Pitchfork yr enim lo-fi vasati vatengesa izvo. Tumblr purazi-ku-tafura kodzero dzebhasikoro chero. Anim keffiyeh carles cardigan. Velit seitan mcsweeney's photo booth 3 wolf moon irure. Cosby sweater lomo jean shorts, williamsburg hoodie minim qui pamwe hausati wanzwa nezvavo et 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 ndebvu. Freegan ndebvu aliqua cupidatat mcsweeney's vero. Cupidatat mana ako ini, ea helvetica nulla carles. Tattooed cosby sweater chikafu rori, 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 deelectus. Fap craft doro deserunt skateboard ea. Lomo bhasikoro kodzero adipisicing banh mi, velit ea sunt next level locavore single-origin coffee in magna veniam. Hupenyu hwepamusoro id vinyl, echo park consequat quis aliquip banh mi pitchfork. Vero VHS est adipisicing. Consectetur nisi DIY minim messenger bag. Cred ex in, inogara yakasimba deelectus 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 chero deelectus chikafu rori. Sapiente synth id imaginenda. Locavore sed helvetica cliche irony, mabhanan'ana iwe pamwe hausati wanzwa nezvawo consequat hoodie gluten-isina lo-fi fap aliquip. Labore elit placeat vasati vatengesa, 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.
Kuti uwedzere nyore scrollspy maitiro kune yako topbar navigation, ingo wedzera data-spy="scroll"
kune chinhu chaunoda kunosora (kazhinji uyu unenge uri muviri) uye data-target=".navbar"
kusarudza kuti ndeipi nav yekushandisa. Iwe unozoda kushandisa scrollspy nechikamu .nav
.
- <body data-spy = "scroll" data-target = ".navbar" > ... </ body>
Fonera iyo scrollspy kuburikidza neJavaScript:
- $ ( '#navbar' ). scrollspy ()
<a href="#home">home</a>
inofanirwa kuenderana nechimwe chinhu chiri mudom senge
<div id="home"></div>
.
Paunenge uchishandisa scrollspy pamwe nekuwedzera kana kubvisa zvinhu kubva kuDOM, iwe unozofanirwa kufonera nzira yekuzorodza senge:
- $ ( '[data-spy="scroll"]' ). chimwe nechimwe ( basa () {
- var $ spy = $ ( iyi ). scrollspy ( 'refresh' )
- });
Sarudzo dzinogona kupfuudzwa kuburikidza nedata hunhu kana JavaScript. Nezve data hunhu, wedzera iyo sarudzo zita ku data-
, semu data-offset=""
.
Zita | type | default | tsananguro |
---|---|---|---|
offset | nhamba | 10 | Mapikisi ekubvisa kubva kumusoro paunenge uchiverenga nzvimbo yekupumburudza. |
Chiitiko | Tsanangudzo |
---|---|
activate | Chiitiko ichi chinopisa chero chinhu chitsva chikavhurwa neiyo scrollspy. |
Wedzera nekukurumidza, kusimba kwetabhu kushanda kwekuchinja kuburikidza nemapaneru ezvemukati zvemukati, kunyangwe kuburikidza nekudonhedza menyu.
Raw denim pamwe hausati wanzwa nezvavo zvipfupi zvejean 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. Aliquip placeat salvia cillum iphone. Seitan aliquip quis cardigan american apparel, 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 vasati vatengesa master cleanse gluten-isina squid scenester freegan cosby juzi. Fanny pack portland seitan DIY, art party locavore wolf cliche high life echo park Austin. Cred vinyl keffiyeh DIY salvia PBR, banh mi vasati vatengesa purazi-ku-tafura VHS viral locavore cosby juzi. Lomo wolf viral, mustache readymade thundercats keffiyeh craft beer marfa ethical. Wolf salvia freegan, sartorial keffiyeh echo park vegan.
Gonesa tabable tabs kuburikidza neJavaScript (tebhu yega yega inoda kuvhurwa yega):
- $ ( '#myTab a' ). tinya ( basa ( e ) {
- e . kudziviriraDefault ();
- $ ( izvi ). tab ( 'kuratidza' );
- })
Iwe unogona kumisa ma tabo ega ega munzira dzinoverengeka:
- $ ( '#myTab a[href="#profile"]' ). tab ( 'kuratidza' ); // Sarudza tab nezita
- $ ( '#myTab a:first' ). tab ( 'kuratidza' ); // Sarudza yekutanga tab
- $ ( '#myTab a:kupedzisira' ). tab ( 'kuratidza' ); // Sarudza yekupedzisira tab
- $ ( '#myTab li:eq(2) a' ). tab ( 'kuratidza' ); // Sarudza yechitatu tebhu (0-indexed)
Unogona kumisikidza tebhu kana piritsi kufamba usinganyore chero JavaScript nekungotsanangura data-toggle="tab"
kana data-toggle="pill"
pane chinhu. Kuwedzera iyo nav
uye nav-tabs
makirasi kune iyo tebhu ul
ichashandisa iyo Bootstrap tebhu styling.
- <ul class = "nav nav-tabs" >
- <li><a href = "#home" data-toggle = "tab"> Kumba </a></li >
- <li><a href = "#profile" data-toggle = "tab"> Profile </a></li >
- <li><a href = "#messages" data-toggle = "tab"> Mameseji </a> </li >
- <li><a href = "#settings" data-toggle = "tab"> Zvirongwa </a></li >
- </ul>
Inomisikidza chinhu chetabhu uye mudziyo wemukati. Tab inofanirwa kunge iine data-target
kana href
yakanangana nemudziyo node muDOM.
- <ul class = "nav nav-tabs" id = "myTab" >
- <li class = "active" ><a href = "#home"> Kumba </a></li >
- <li><a href = "#profile"> Profile </a> </li>
- <li><a href = "#messages"> maMessages </a> </li>
- <li><a href = "#settings"> Zvirongwa </a> </li>
- </ul>
- <div class = "tab-content" >
- <div class = "tab-pane inoshanda" id = "kumba" > ... </div>
- <div class = "tab-pane" id = "profile" > ... </div>
- <div class = "tab-pane" id = "messages" > ... </div>
- <div class = "tab-pane" id = "settings" > ... </div>
- </ div>
- <script>
- $ ( basa () {
- $ ( '#myTab a:kupedzisira' ). tab ( 'kuratidza' );
- })
- </script>
Chiitiko | Tsanangudzo |
---|---|
show | Ichi chiitiko chinopisa pane tab show, asi iyo itsva tebhu isati yaratidzwa. Shandisa event.target uye event.relatedTarget kunanga iyo inoshanda tebhu uye yapfuura inoshanda tebhu (kana iripo) zvichiteerana. |
kuratidzwa | Ichi chiitiko chinopisa pane tab show mushure mekunge tab yaratidzwa. Shandisa event.target uye event.relatedTarget kunanga iyo inoshanda tebhu uye yapfuura inoshanda tebhu (kana iripo) zvichiteerana. |
- $ ( 'a[data-toggle="tab"]' ). pa ( 'inoratidzwa' , basa ( e ) {
- e . chinangwa // activated tab
- e . yakabatanaTarget // yapfuura tab
- })
Yakafuridzirwa neyakanakisa jQuery.tipsy plugin yakanyorwa naJason Frame; Maturusi ivhezheni yakagadziridzwa, isingavimbi nemifananidzo, shandisa CSS3 yemifananidzo, uye data-maitiro ekuchengetera mazita enzvimbo.
Nekuda kwezvikonzero zvekuita, iyo tooltip uye popover data-apis vanopinda, zvichireva kuti unofanira kuzvitangisa iwe pachako .
Hover pamusoro pemalink ari pasi apa kuti uone maturusi ekushandisa:
Tight bhurugwa next level keffiyeh pamwe hausati wanzwa nezvavo. Photo booth ndebvu mbishi denim letterpress vegan messenger bag stumptown. Farm-to-table seitan, mcsweeney's fixie sustainable quinoa 8-bit american nguo ine terry richardson vinyl chambray. Ndebvu stumptown, cardigans banh mi lomo thundercats. Tofu biodiesel williamsburg marfa, mana loko mcsweeney's cleanse vegan chambray. A really artisan artisan whatever keytar , scenester farm-to-table banksy Austin twitter handle freegan cred raw denim single-origin coffee viral.
Paunenge uchishandisa maturusi uye popovers neBootstrap ekuisa mapoka, iwe unofanirwa kuseta iyo container
(yakanyorwa pazasi) sarudzo kudzivirira zvisingadiwe mhedzisiro.
Tamba chishandiso kuburikidza neJavaScript:
- $ ( '#muenzaniso' ). tooltip ( sarudzo )
Sarudzo dzinogona kupfuudzwa kuburikidza nedata hunhu kana JavaScript. Nezve data hunhu, wedzera iyo sarudzo zita ku data-
, semu data-animation=""
.
Zita | type | default | tsananguro |
---|---|---|---|
animation | boolean | chokwadi | shandisa css fade shanduko kune tooltip |
html | boolean | nhema | Isa html muchokushandisa. Kana nhema, nzira yejquery text ichashandiswa kuisa zvirimo mudom. Shandisa zvinyorwa kana uchinetseka nezve XSS kurwiswa. |
kuiswa | tambo | basa | 'pamusoro' | nzira yekuisa iyo tooltip - pamusoro | pasi | left | rudyi |
selector | tambo | nhema | Kana sarudzo yakapihwa, zviro zveturusi zvinopihwa kune izvo zvakatarwa. |
title | tambo | basa | '' | default title value kana `title` tag isipo |
trigger | tambo | 'hover focus' | kuti tooltip inotangwa sei - tinya | hovha | focus | manual. Ziva iwe kesi pass trigger mutliple, nzvimbo yakakamurwa, trigger mhando. |
delay | nhamba | object | 0 | kunonoka kuratidza uye kuvanza iyo tooltip (ms) - haishande kune manual trigger type Kana nhamba yapihwa, kunonoka kunoiswa kune ese ari maviri hide/show Chimiro chechinhu ndeichi: |
mudziyo | tambo | nhema | nhema | Inoisa tip kune chimwe chinhu |
- <a href = "#" data-toggle = "tooltip" title = "tooltip yekutanga"> tenderera pamusoro pangu </a>
Inonamira chibatiso cheturusi kune muunganidzwa wezvinhu.
Inoratidza chekushandisa chechinhu.
- $ ( '#element' ). tooltip ( 'show' )
Inovanza zano rekushandisa.
- $ ( '#element' ). tooltip ( 'hide' )
Inoshandura matipi echinhu.
- $ ( '#element' ). tooltip ( 'toggle' )
Inoviga nekuparadza mudziyo wekushandisa.
- $ ( '#element' ). tooltip ( 'paradza' )
Wedzera zvidiki zvakafukidzwa zvemukati, sezviya zviri paPadad, kune chero chinhu cheimba yechipiri ruzivo. Famba pamusoro pebhatani kuti utange popover. Inoda Tooltip kuti ibatanidzwe.
Sarudzo ina dziripo: kumusoro, kurudyi, pasi, uye kuruboshwe zvakaenderana.
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.
Hapana markup inoratidzwa sepopovers inogadzirwa kubva kuJavaScript uye zviri mukati data
mehunhu.
Gonesa mapopovers kuburikidza neJavaScript:
- $ ( '#muenzaniso' ). popover ( sarudzo )
Sarudzo dzinogona kupfuudzwa kuburikidza nedata hunhu kana JavaScript. Nezve data hunhu, wedzera iyo sarudzo zita ku data-
, semu data-animation=""
.
Zita | type | default | tsananguro |
---|---|---|---|
animation | boolean | chokwadi | shandisa css fade shanduko kune tooltip |
html | boolean | nhema | Isa html mune popover. Kana nhema, nzira yejquery text ichashandiswa kuisa zvirimo mudom. Shandisa zvinyorwa kana uchinetseka nezve XSS kurwiswa. |
kuiswa | tambo | basa | 'rudyi' | maitiro ekuisa popover - kumusoro | pasi | left | rudyi |
selector | tambo | nhema | kana sarudzo yakapihwa, zviro zveturusi zvinopihwa kune izvo zvakatarwa |
trigger | tambo | 'tinya' | kuti popover inokonzereswa sei - tinya | hovha | focus | manual |
title | tambo | basa | '' | default title value kana `title` hunhu asipo |
content | tambo | basa | '' | default content value kana `data-content` asipo |
delay | nhamba | object | 0 | kunonoka kuratidza uye kuvanza iyo popover (ms) - haishande kune manual trigger type Kana nhamba yapihwa, kunonoka kunoiswa kune ese ari maviri hide/show Chimiro chechinhu ndeichi: |
mudziyo | tambo | nhema | nhema | Inoisa popover kune chimwe chinhu |
Nekuda kwezvikonzero zvekuita, Tooltip nePopover data-apis vanosarudza kupinda. Kana uchida kuzvishandisa ingotaura sarudzo yekusarudza.
Inotanga popover yekuunganidza zvinhu.
Inoburitsa zvinhu popover.
- $ ( '#element' ). popover ( 'show' )
Inoviga zvinhu zvinobuda.
- $ ( '#element' ). popover ( 'hide' )
Toggles an elements popover.
- $ ( '#element' ). popover ( 'toggle' )
Inoviga uye inoparadza popover yechinhu.
- $ ( '#element' ). popover ( 'paradza' )
Wedzera mashandiro ekudzinga kune ese mameseji echenjedzo ane plugin iyi.
Chinja ichi neicho uye edza zvakare. Duis mollis, est non commodo luctus, nisi erat porttitor ligula, eget lacinia odio sem nec elit. Cras mattis consectetur purus sit amet fermentum.
Ita kuti chenjedzo iraswe kuburikidza neJavaScript:
- $ ( ".alert" ). chenjerera ()
Ingo wedzera data-dismiss="alert"
kune yako bhatani rekuvhara kuti upe otomatiki yambiro yepedyo kushanda.
- <a class = "close" data-dismiss = "alert" href = "#" > × </a>
Inopeta chenjedzo dzese nekushanda kwepedyo. Kuti zviziviso zvako zvibude kana zvakavharwa, ita shuwa kuti vane .fade
uye .in
kirasi yatoiswa kwazviri.
Inovhara chenjedzo.
- $ ( ".alert" ). chenjedzo ( 'vhara' )
Bootstrap's alert kirasi inofumura zviitiko zvishoma zvekukochekera mukuita kweyambiro.
Chiitiko | Tsanangudzo |
---|---|
pedyo | Ichi chiitiko chinopisa nekukasira kana close nzira yemuenzaniso inodanwa. |
yakavharwa | Ichi chiitiko chinodzingwa kana yambiro yavharwa (ichamirira css shanduko kuti ipedze). |
- $ ( '#my-alert' ). sunga ( 'yakavharwa' , basa () {
- // ita chimwe chinhu…
- })
Tora masitaera epasi uye inochinjika tsigiro yezvinhu zvinoputsika senge maaccordion uye kufamba.
* Inoda iyo Transitions plugin kuti ibatanidzwe.
Tichishandisa iyo yekudonha plugin, isu takavaka yakapusa accordion style widget:
- <div kirasi = "accordion" id = "accordion2" >
- <div kirasi = "accordion-boka" >
- <div kirasi = "accordion-heading" >
- <a class = "accordion-toggle" data-toggle = "collapse" data-parent = "#accordion2" href = "#collapseOne"> _
- Chinopindika Boka Chinhu #1
- </a>
- </ div>
- <div id = "collapseOne" kirasi = "accordion-muviri kudonha mukati" >
- <div kirasi = "accordion-mukati" >
- Anim pariatur cliche...
- </ div>
- </ div>
- </ div>
- <div kirasi = "accordion-boka" >
- <div kirasi = "accordion-heading" >
- <a class = "accordion-toggle" data-toggle = "collapse" data-parent = "#accordion2" href = "#collapseTwo"> _
- Collapsible Boka Chinhu #2
- </a>
- </ div>
- <div id = "collapseTwo" kirasi = "accordion-body collapse" >
- <div kirasi = "accordion-mukati" >
- Anim pariatur cliche...
- </ div>
- </ div>
- </ div>
- </ div>
- ...
Iwe unogona zvakare kushandisa plugin pasina accordion markup. Gadzira bhatani kushandura kuwedzera uye kudonha kwechimwe chinhu.
- <button type = "bhatani" class = "btn btn-danger" data-toggle = "collapse" data-target = "#demo" >
- simple collapsible
- </ button>
- <div id = "demo" kirasi = "kudonha mukati" > … </div>
Ingo wedzera data-toggle="collapse"
uye data-target
kune chinhu kuti ugozvigadzika kutonga kwechinhu chinodonha. Hunhu data-target
hunogashira css selector yekushandisa kuputsika. Iva nechokwadi chekuwedzera kirasi collapse
kune chinhu chinoputika. Kana uchida kuti risavhurika, wedzera imwe kirasi in
.
Kuwedzera accordion-senge boka manejimendi kune inodonha kutonga, wedzera iyo data hunhu data-parent="#selector"
. Tarisa kune demo kuti uone izvi mukuita.
Vhura nemaoko ne:
- $ ( ".collapse" ). kuputsika ()
Sarudzo dzinogona kupfuudzwa kuburikidza nedata hunhu kana JavaScript. Nezve data hunhu, wedzera iyo sarudzo zita ku data-
, semu data-parent=""
.
Zita | type | default | tsananguro |
---|---|---|---|
mubereki | selector | nhema | Kana sesarudzi zvino zvese zvinopeta pasi pemubereki wataurwa zvichavharwa kana chinhu chinopetana ichi charatidzwa. (zvakafanana nemaitiro echinyakare accordion) |
toggle | boolean | chokwadi | Inoshandura chinhu chinopeta pakukumbira |
Inobatisa zvirimo sechinhu chinogoneka. Inobvuma sarudzo dzaungada object
.
- $ ( '#myCollapsible' ). kuparara ({
- toggle : nhema
- })
Inoshandura chinhu chinopeta kuti chiratidze kana kuvanzwa.
Inoratidza chinhu chinopeta.
Inoviga chinhu chinopeta.
Bootstrap's kudonha kirasi inofumura zviitiko zvishoma zvekukochekera mukudonha kushanda.
Chiitiko | Tsanangudzo |
---|---|
show | Ichi chiitiko chinopisa nekukasira kana show nzira yemuenzaniso inodanwa. |
kuratidzwa | Ichi chiitiko chinodzingwa kana chinhu chekudonha chaitwa kuti chionekwe kumushandisi (chichamirira css shanduko kuti ipedze). |
hide | Chiitiko ichi chinodzingwa pakarepo kana hide nzira yadaidzwa. |
zvakavanzika | Chiitiko ichi chinodzingwa kana chinhu chekudonha chakavigwa kubva kumushandisi (chinomirira css shanduko kuti ipedze). |
- $ ( '#myCollapsible' ). pa ( 'zvakavanzika' , basa () {
- // ita chimwe chinhu…
- })
Slideshow iri pazasi inoratidza generic plugin uye chikamu chekuchovha bhasikoro kuburikidza nezvinhu zvakaita secarousel.
- <div id = "myCarousel" kirasi = "carousel slide" >
- <ol kirasi = "carousel-zviratidzo" >
- <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 zvinhu -->
- <div kirasi = "carousel-mukati" >
- <div kirasi = "chinhu chinoshanda" > ... </div>
- <div class = "chinhu" > ... </div>
- <div class = "chinhu" > ... </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 = "inotevera" > › </a>
- </ div>
Shandisa data hunhu kudzora zviri nyore chinzvimbo checarousel. data-slide
inogamuchira mazwi makuru prev
kana next
, iyo inoshandura nzvimbo yemasiraidhi maererano neyairi ikozvino. Neimwe nzira, shandisa data-slide-to
kupfuudza masiraidhi index kune carousel data-slide-to="2"
, inosvetuka ndiyo nzvimbo yemasiraidhi kune imwe index inotanga na 0
.
Fonera carousel nemaoko ne:
- $ ( '.carousel' ). carousel ()
Sarudzo dzinogona kupfuudzwa kuburikidza nedata hunhu kana JavaScriptz. Nezve data hunhu, wedzera iyo sarudzo zita ku data-
, semu data-interval=""
.
Zita | type | default | tsananguro |
---|---|---|---|
interval | nhamba | 5000 | Huwandu hwenguva yekunonoka pakati pekuita bhasikoro chinhu. Kana nhema, carousel haizongotenderera ichitenderera. |
pause | tambo | "hovha" | Imbomira kuchovha bhasikoro pambeva yekupinda uye kutangazve kubhasikoro kwekarosi paguva remakonzo. |
Inotanga carousel ine sarudzo yesarudzo object
uye inotanga kuchovha bhasikoro kuburikidza nezvinhu.
- $ ( '.carousel' ). carousel ({
- nguva : 2000
- })
Kutenderera nepakati pezvinhu zvecarousel kubva kuruboshwe kuenda kurudyi.
Inomisa carousel kubva kubhasikoro kuburikidza nezvinhu.
Inotenderedza carousel kune imwe furemu (0 yakavakirwa, yakafanana neyakarongwa).
Kutenderera kune chinhu chapfuura.
Kutenderera kuenda kuchinhu chinotevera.
Bootstrap's carousel kirasi inofumura zviitiko zviviri zvekukochekera mukuita kwecarousel.
Chiitiko | Tsanangudzo |
---|---|
slide | Ichi chiitiko chinopisa nekukasira kana slide nzira yemuenzaniso yakumbirwa. |
slid | Ichi chiitiko chinodzingwa kana carousel yapedza shanduko yayo yemasiraidhi. |
Yekutanga, yakawedzerwa zviri nyore plugin yekukurumidza kugadzira anoyevedza typeaheads nechero fomu yekunyora mameseji.
- <input type = "text" data-provide = "typeahead" >
Iwe autocomplete="off"
unozoda kuseta kudzivirira default browser mamenu kuti asaonekwe pamusoro peBootstrap typeahead kudonha.
Wedzera data hunhu kunyoresa chinhu chine typeahead mashandiro sezvakaratidzwa mumuenzaniso uri pamusoro.
Fonera iyo typeahead nemaoko ne:
- $ ( '.typeahead' ). typehead ()
Sarudzo dzinogona kupfuudzwa kuburikidza nedata hunhu kana JavaScript. Nezve data hunhu, wedzera iyo sarudzo zita ku data-
, semu data-source=""
.
Zita | type | default | tsananguro |
---|---|---|---|
source | array, basa | [ ] | Data source yekubvunza nezvayo. Inogona kunge iri tambo dzakawanda kana basa. Basa racho rinopfuura nharo mbiri, query kukosha mundima yekupinza uye process callback. Basa racho rinogona kushandiswa zvakawiriraniswa nekudzorera kwainobva data zvakananga kana kuti asynchronously kuburikidza process necallback's single argument. |
zvinhu | nhamba | 8 | Huwandu hwezvinhu zvicharatidzwa mukudonhedza. |
minLength | nhamba | 1 | Hurefu hwemavara hudiki hunodiwa usati watanga mazano ekuzadzisa otomatiki |
matcher | basa | nyaya isinganzwisisi | Nzira inoshandiswa kuona kana mubvunzo uchienderana nechimwe chinhu. Inogamuchira nharo imwe chete, item iyo yekuedza mubvunzo. Svika pane zvauri kutsvaga ne this.query . Dzosa boolean true kana mubvunzo uchienderana. |
sorter | basa | machisi chaiwo, nyaya isinganzwisisike |
Nzira yakashandiswa kugadzirisa mhinduro dzega. Inogamuchira nharo imwe chete items uye ine chiyero cheiyo typeahead muenzaniso. Revera mubvunzo wazvino ne this.query . |
updater | basa | inodzorera chinhu chakasarudzwa | Nzira yakashandiswa kudzosera chinhu chakasarudzwa. Inogamuchira nharo imwe chete, iyo item uye ine chiyero cheiyo typeahead muenzaniso. |
highlighter | basa | inosimbisa ese machisi akasarudzika | Nzira yakashandiswa kuratidza mhinduro dzakakwana. Inogamuchira nharo imwe chete item uye ine chiyero cheiyo typeahead muenzaniso. Inofanira kudzorera html. |
Inotanga inopinza ine typeahead.
Iyo subnavigation kuruboshwe idemo mhenyu yeaffix plugin.
Kuti uwedzere nyore affix maitiro kune chero chinhu, ingo wedzera data-spy="affix"
kune chinhu chaunoda kunosora. Wobva washandisa maoffset kutsanangura nguva yekushandura kupinza kwechinhu nekudzima.
- <div data-spy = "affix" data-offset-top = "200" > ... </div>
affix
,
affix-top
, uye
affix-bottom
. Rangarira kutarisa mubereki angangodonha kana affix ichipinda mukati sezvo ichibvisa zvirimo kubva kune yakajairika kuyerera kwepeji.
Fonera iyo affix plugin kuburikidza neJavaScript:
- $ ( '#navbar' ). simbisa ()
Sarudzo dzinogona kupfuudzwa kuburikidza nedata hunhu kana JavaScript. Nezve data hunhu, wedzera iyo sarudzo zita ku data-
, semu data-offset-top="200"
.
Zita | type | default | tsananguro |
---|---|---|---|
offset | nhamba | basa | object | 10 | MaPixels ekubvisa kubva pachiratidziro kana uchiverenga chinzvimbo chemupumburu. Kana nhamba imwe chete yapihwa, iyo yekubvisa inozoiswa kumusoro nekuruboshwe nzira. Kuti uteerere gwara rimwe chete, kana akawanda akasiyana akasarudzika, ingopa chinhu offset: { x: 10 } . Shandisa basa kana iwe uchinge uchinge uchinge uchinge uchinge uchinge uchinge uchinge uchinge uchinge uchinge uchinge uchingerwa offset (inobatsira kune mamwe anopindura magadzirirwo). |