JavaScript ezali
Mema ba composants ya Bootstrap na vie na plus de douzaine ya ba plugins ya jQuery personnalisé. Kokɔtisa yango nyonso na pɛtɛɛ nyonso, to moko na moko.
Mema ba composants ya Bootstrap na vie na plus de douzaine ya ba plugins ya jQuery personnalisé. Kokɔtisa yango nyonso na pɛtɛɛ nyonso, to moko na moko.
Ba plugins ekoki kozala moko moko (kosalela ba *.js
fichiers moko moko ya Bootstrap), to nionso na mbala moko (kosalela bootstrap.js
to oyo ekitisami bootstrap.min.js
).
Bango mibale bootstrap.js
pe bazali bootstrap.min.js
na ba plugins nionso na fichier moko. Tyá mpe kaka moko.
Ba plugins misusu na ba composants ya CSS etali ba plugins misusu. Soki otie ba plugins moko moko, sala makasi otala ba dépendances oyo na ba docs. Yeba pe que ba plugins nionso e dépend na jQuery (yango elakisi que jQuery esengeli ezala na kati liboso ya ba fichiers ya ba plugin). Consultez notrebower.json
po omona ba versions nini ya jQuery ezo soutenir.
Okoki kosalela ba plugins nionso ya Bootstrap kaka na nzela ya API ya marquage sans kokoma ata ligne moko ya JavaScript. Oyo ezali API ya liboso ya Bootstrap mpe esengeli kozala likambo na yo ya liboso oyo osengeli kotalela ntango ozali kosalela plugin.
Yango elobami, na makambo mosusu ekoki kozala malamu kokanga fonctionnalité oyo. Yango wana, tozali mpe kopesa makoki ya kokanga API ya attribut ya ba données na ko délinger ba événements nionso na document namespaced na data-api
. Oyo ezali komonana boye:
Na lolenge mosusu, mpo na ko cibler plugin moko ya sikisiki, kotia kaka kombo ya plugin lokola esika ya nkombo elongo na esika ya nkombo ya data-api lokola oyo:
Kosalela te ba attributs ya ba données oyo ewutaka na ba plugins ebele na élément moko. Ndakisa, bouton ekoki te kozala na tooltip mpe kobalusa modal. Mpo na kokokisa yango, salelá eloko oyo batyaka na kati.
Tondimi mpe ete osengeli kozala na likoki ya kosalela ba plugins nyonso ya Bootstrap kaka na nzela ya API ya JavaScript. Ba API nionso ya leta ezali ba méthodes moko, oyo ekoki kozala na chaîne, mpe ezongisaka bosangisi oyo esalemaki na yango.
Ba méthodes nionso esengeli kondima objet ya ba options optionnelles, chaîne oyo ezo cibler méthode moko boye, to eloko moko te (oyo ebandisaka plugin na comportement par défaut):
Plugin moko na moko e exposer pe constructeur na yango brut na Constructor
propriété moko: $.fn.popover.Constructor
. Soki olingi kozwa instance ya plugin moko boye, zwa yango mbala moko na élément moko: $('[rel="popover"]').data('popover')
.
Okoki kobongola ba paramètres ya liboso ya plugin na kobongola Constructor.DEFAULTS
eloko ya plugin:
Tango mosusu esengeli kosalela ba plugins ya Bootstrap na ba cadres mosusu ya UI. Na makambo oyo, bokutani ya esika ya nkombo ekoki kobima ntango mosusu. Soki likambo yango esalemi, okoki kobenga .noConflict
plugin oyo olingi kozongisa motuya na yango.
Bootstrap epesaka ba événements personnalisés pona ba actions unique ya ba plugins mingi. Mingimingi, yango eyaka na lolenge ya infinitif mpe ya participe eleki - esika oyo infinitif (ex. show
) ebandisami na ebandeli ya likambo moko, mpe lolenge na yango ya participe ya kala (ex. shown
) ebandisami na bosilisi ya likambo moko.
Kobanda na 3.0.0, makambo nyonso ya Bootstrap ezali na esika ya nkombo.
Ba événements infinitifs nionso epesaka preventDefault
fonctionnalité. Yango epesaka makoki ya kopekisa exécution ya action moko avant ebanda.
Version ya moko na moko ya ba plugins jQuery ya Bootstrap ekoki kozuama na nzela ya VERSION
propriété ya constructeur ya plugin. Ndakisa, mpo na plugin ya tooltip:
Ba plugins ya Bootstrap ezongaka sima te particulièrement gracement tango JavaScript ezali désactivé. Soki ozali komibanzabanza mpo na mayele ya mosaleli na likambo oyo, salelá <noscript>
mpo na kolimbola likambo (mpe ndenge ya kofungola lisusu JavaScript) epai ya basaleli na yo, mpe/to kobakisa ba fallbacks na yo moko oyo olingi.
Bootstrap esungaka officiellement te ba bibliothèques ya JavaScript ya troisième partie lokola Prototype to jQuery UI. Malgré .noConflict
mpe ba événements namespaced, ekoki kozala na ba problèmes ya compatibilité oyo esengeli o bongisa yo moko.
Mpo na ba effets ya transition ya pete, kotia transition.js
mbala moko pembeni ya ba fichiers JS misusu. Soki ozali kosalela oyo esangisi (to oyo ekitisami) bootstrap.js
, ntina ya kokɔtisa oyo ezali te —ezali deja wana.
Transition.js ezali mosungi ya moboko mpo na transitionEnd
makambo lokola mpe emulateur ya transition ya CSS. Esalelamaka na ba plugins mosusu mpo na kotala soki ezali na lisungi ya mbongwana ya CSS mpe mpo na kokanga ba transitions oyo ekangami.
Ba transitions ekoki kozala désactivé na mokili mobimba na kosalelaka fragment ya JavaScript oyo elandi, oyo esengeli koya sima ya transition.js
(to bootstrap.js
to bootstrap.min.js
, ndenge ekoki kozala) e charger:
Ba modales ezali rationalisé, kasi flexible, ba prompts ya dialogue na fonctionnalité minimum oyo esengeli mpe ba défauts intelligents.
Sala makasi ofungola modal moko te tango mosusu ezali kaka komonana. Kolakisa ba modal koleka moko na mbala moko esengaka code personnalisé.
Meka ntango nyonso kotia code HTML ya modal na esika ya nivo ya likolo na mokanda na yo mpo na koboya biloko mosusu oyo ezali na bopusi na lolenge ya komonana mpe/to mosala ya modal.
Ezali na mwa ba caveats na oyo etali kosalela ba modal na ba appareils mobiles. Tala ba docs na biso ya soutien ya navigateur pona ba détails.
Na tina ya ndenge HTML5 elimbolaka sémantique na yango, autofocus
attribut HTML ezali na effet moko te na ba modal ya Bootstrap. Mpo na kozwa eloko moko, salelá mwa JavaScript oyo olingi:
Modal oyo esalemi na motó, nzoto, mpe ensemble ya misala na nse ya lokasa.
Toggle modal moko na nzela ya JavaScript na kofinaka bouton oyo ezali awa na nse. Ekokita mpe ekosila na kati longwa na likoló ya lokasa.
Kobosana te kobakisa role="dialog"
mpe aria-labelledby="..."
, kosala référence na titre modal, na .modal
, mpe role="document"
na .modal-dialog
yango moko.
En plus, okoki kopesa description ya dialogue modal na yo na aria-describedby
on .modal
.
Ko intégrer ba vidéos ya YouTube na ba modals esengaka JavaScript ya kobakisa te na Bootstrap pona ko arrêter automatiquement lecture pe ebele. Tala post oyo ya Stack Overflow ya lisungi mpo na koyeba makambo mosusu.
Ba modales ezali na ba taille mibale ya option, oyo ezali na nzela ya ba classes ya modificateur oyo esengeli kotiama na .modal-dialog
.
Mpo na ba modal oyo emonanaka kaka na esika ya kosila mpo na kotala, longola .fade
kelasi na bilembo na yo ya modal.
Pona ko profiter na système ya grille Bootstrap na kati ya modal moko, kaka nest .row
s na kati ya .modal-body
et puis salela ba classes ya système ya grille normal.
Ozali na liboke ya ba boutons oyo nionso e déclencher modal moko, kaka na ba contenus un peu différent? Salelá event.relatedTarget
mpe bizaleli ya HTMLdata-*
(ekoki kozala na nzela ya jQuery ) mpo na kobongola makambo oyo ezali na kati ya modal engebene bouton nini obɛtaki. Tala ba docs ya Modal Events pona ba détails na relatedTarget
, .
Plugin modal ebalusaka ba contenus na yo oyo ebombami na demande, na nzela ya ba attributs ya ba données to JavaScript. Ebakisi mpe .modal-open
na <body>
mpo na koboya bizaleli ya défilement par défaut mpe ebimisaka a .modal-backdrop
mpo na kopesa esika ya kofina mpo na koboya ba modal oyo elakisami ntango ozali kofina libanda ya modal.
Activer un modal sans kokoma JavaScript. Set data-toggle="modal"
na élément ya contrôleur, lokola bouton, elongo na data-target="#foo"
to href="#foo"
mpo na ko cibler modal spécifique mpo na ko toggler.
Benga modal na id myModal
na ligne moko ya JavaScript:
Ba options ekoki koleka na nzela ya ba attributs ya ba données to JavaScript. Mpo na ba attributs ya ba données, bakisa kombo ya option na data-
, lokola na data-backdrop=""
.
Nkombo | lolenge | mbeba | ndimbola |
---|---|---|---|
fond d’écran | boolean to na molongo'static' |
ya solo | Ezali na élément moko ya modal-backdrop. Na lolenge mosusu, lakisa static mpo na fond d'écran oyo ekangaka te modal na clic. |
clavier ya kosala | boolean | ya solo | Ekangaka modal tango touche ya escape efinamaki |
kolakisa | boolean | ya solo | Ezali kolakisa modal tango ebandisami. |
mosika | nzela | lokuta | Option oyo ezali déprecated banda v3.3.0 mpe elongolami na v4. Tosengi na esika na yango kosalela modèle ya côté client to cadre ya bokangami ya ba données, to kobenga jQuery.load yo moko. Soki URL ya mosika epesami, makambo ekozala chargé mbala moko na nzela ya méthode ya jQuery |
.modal(options)
Active contenus na yo lokola modal. Andimi ba options moko ya option object
.
.modal('toggle')
Manuellement ebalukaka modal moko. Ezongi na mobengi yambo modal elakisama to ebombama mpenza (elingi koloba liboso ete likambo shown.bs.modal
to hidden.bs.modal
esalema).
.modal('show')
Manuellement efungolaka modal moko. Ezongi na mobengi yambo modal elakisama mpenza (elingi koloba liboso ete shown.bs.modal
likambo esalema).
.modal('hide')
Manuellement abombaka modal moko. Ezongi na mobengi yambo ete modal ebombama mpenza (elingi koloba liboso ete hidden.bs.modal
likambo esalema).
.modal('handleUpdate')
Ebongisaka lisusu positionnement ya modal mpo na ko contrer barre de défilement na cas moko esengeli ebima, oyo ekosala que modal epumbwa na gauche.
Esengeli kaka tango hauteur ya modal ebongwanaka tango ezali polele.
Classe modal ya Bootstrap e exposer mua ba événements pona ko crochet na fonctionnalité modal.
Ba événements modaux nionso ezo betama na modal yango moko (c.a.d. na <div class="modal">
).
Lolenge ya likambo | Ndimbola |
---|---|
elakiseli.bs.modal | Evenement oyo ezo beta mbala moko tango show méthode ya instance ebengami. Soki euti na kofina, eloko oyo obɛti ezali lokola relatedTarget eloko ya likambo. |
elakisami.bs.modal | Evenement oyo ezo beta tango modal esalemi visible na mosaleli (ekozela ba transitions ya CSS esila). Soki euti na kofina, eloko oyo obɛti ezali lokola relatedTarget eloko ya likambo. |
kobomba.bs.modal | Evenement oyo ezo beta mbala moko tango hide méthode ya instance ebengami. |
ebombami.bs.modal | Evenement oyo ezo beta tango modal esili kobombama na mosaleli (ekozela ba transitions ya CSS esila). |
ekɔtisami.bs.modal | Evenement oyo ezo beta tango modal a charger contenus en utilisant remote option. |
Bakisa ba menu ya kokita na pene na eloko nyonso na plugin oyo ya pete, bakisa mpe navbar, ba onglets, mpe ba pilili.
Na nzela ya ba attributs ya ba données to JavaScript, plugin oyo ezali kokita ebalusaka makambo oyo ebombami (ba menu oyo ezali kokita) na kobongola .open
kelasi na eloko ya liste ya baboti.
Na ba appareils mobiles, kofungola déroulant ebakisi esika .dropdown-backdrop
ya kofina lokola esika ya kofina mpo na kokanga ba menu ya kokita ntango ozali kobɛta libanda ya menu, esengelami mpo na lisungi ya malamu ya iOS. Yango elingi koloba ete mpo na kolongwa na menu oyo ezali polele mpo na kokende na menu mosusu oyo ezali kokita, esɛngaka obɛta lisusu mingi na telefone ya mabɔkɔ.
Liyebisi: data-toggle="dropdown"
Attribut etie motema mpo na kokanga ba menu ya kokita na niveau ya application, yango wana ezali likanisi malamu kosalela yango ntango nyonso.
Bakisa data-toggle="dropdown"
na lien to na bouton mpo na kobongola esika oyo ezali kokita.
Mpo na kobatela ba URL ndenge moko na ba boutons ya lien, salelá data-target
attribut na esika ya href="#"
.
Benga ba dropdowns na nzela ya JavaScript:
data-toggle="dropdown"
esɛngami nainoIndépendamment soki obengi dropdown na yo na nzela ya JavaScript to na esika na yango kosalela data-api, data-toggle="dropdown"
esengeli ntango nyonso kozala présent na élément déclencheur ya dropdown.
Moko te
$().dropdown('toggle')
Ezali kobongola menu oyo ezali kokita ya navbar to navigation oyo ezali na onglet oyo epesami.
Ba événements nionso ya dropdown ezo betama na .dropdown-menu
élément parent ya '.
Ba événements nionso ya kokita ezali na relatedTarget
propriété, oyo valeur na yango ezali élément anchor toggling.
Lolenge ya likambo | Ndimbola |
---|---|
elakiseli.bs.kotika yango | Evenement oyo ezo beta mbala moko tango méthode ya instance ya kolakisa ebengami. |
elakisami.bs.kokita ya nse | Evenement oyo ezo beta tango dropdown esalemi komonana na mosaleli (ekozela ba transitions ya CSS, mpo esila). |
bomba.bs.oyo ezali kokita | Evenement oyo ezo beta mbala moko tango méthode ya instance ya kobomba ebengami. |
ebombami.bs.kokita ya nse | Evenement oyo ezo beta tango dropdown esili kobombama na mosaleli (ekozela ba transitions ya CSS, mpo esila). |
Plugin ScrollSpy ezali mpo na kosala mikolo oyo automatiquement ba cibles nav na kotalela position ya défilement. Défiler na esika oyo ezali na se ya navbar mpe tala mbongwana ya kelasi oyo ezali kosala. Ba sous-éléments oyo ezali kokita ekozala mpe na elembo.
Leggings ya publicité keytar, brunch id art fête dolor labore. Pitchfork yr enim lo-fi avant ba teka qui. Tumblr ferme-à-mesa ba droits ya vélo ezala nini. Anim keffiyeh carles cardigan na mokili ya lelo. Velit seitan kiosque ya ba photos ya mcsweeney 3 loup sanza irure. Cosby chandail lomo jean short, williamsburg hoodie minim qui mbala mosusu oyoki bango te et cardigan fonds de fidélité culpa biodiesel wes anderson esthétique. Nihil tatoué accusamus, cred ironie biodiesel keffiyeh artisan ullamco consequat.
Veniam marfa moustache patin, adipisicing fugiat velit mandefu ya fourchette. Freegan mandefu aliqua cupidatat vero ya mcsweeney. Cupidatat minei loko nisi, ea helvetica nulla carles. Tatoué cosby chandail camion ya biloko ya kolia, mcsweeney ya quis non freegan vinyl. Lo-fi wes anderson +1 na nzoto ya moto. Carles exercice non esthétique quis gentrifier. Brooklyn adipisicing bière ya maboko vice keytar deserunt.
Occaecat commodo oyo ezali na biloko ya kolya. Fap artisanat bière deserunt skateboard ea. Lomo vélo droits adipisicing banh mi, velit ea sunt niveau prochain locavore café d'origine unique na magna veniam. Vinyle id ya vie ya likolo, echo parc consequat quis aliquip banh mi fourchette. Vero VHS est ya kopanzana. Consectetur nisi bricolage minim sac de messagerie. Cred ex na, durable 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 sac ya messager marfa nini delectus camion ya biloko ya kolia. Sapiente synth id oyo ekanisami. Locavore sed helvetica cliche ironie, ba mbwa ya nkake oyo mbala mosusu oyoká bango te consequat hoodie sans gluten lo-fi fap aliquip. Labore elit placeat avant ba teka, terry richardson proident brunch nesciunt quis cosby chandail pariatur keffiyeh ut helvetica artisan. Cardigan bière artisanale seitan velit prêt. VHS chambray laboris ezali veniam ya ntango mokuse. Anim mollit minim commodo ullamco ba mbwa ya nkake.
Ba liens ya Navbar esengeli kozala na ba cibles id oyo ekoki ko résoudre. Ndakisa, a <a href="#home">home</a>
esengeli ko correspondre na eloko moko na DOM lokola <div id="home"></div>
.
:visible
oyo ezali cible te ba ignorerBa éléments cibles oyo ezali :visible
selon jQuery te ekozala ignorés mpe ba éléments nav correspondants na bango ekozala jamais souligné.
Ata méthode ya mise en œuvre, scrollspy esengaka kosalela position: relative;
na élément oyo ozali espionnage na yango. Mbala mingi yango nde <body>
. Ntango ozali kosala défilement na biloko mosusu oyo ezali te <body>
, salá makasi ozala na height
ensemble mpe overflow-y: scroll;
osaleli yango.
Mpo na kobakisa na pete bizaleli ya scrollspy na navigation na yo ya topbar, bakisa data-spy="scroll"
na élément oyo olingi kosala espionnage (mingi mingi oyo ekozala na <body>
). Na sima bakisa data-target
attribut na ID to classe ya élément parent ya .nav
composant nionso ya Bootstrap.
Nsima ya kobakisa position: relative;
na CSS na yo, benga scrollspy na nzela ya JavaScript:
.scrollspy('refresh')
Ntango ozali kosalela scrollspy elongo na kobakisa to kolongola biloko na DOM, ekosɛnga obenga lolenge ya kozongisa sika lokola boye:
Ba options ekoki koleka na nzela ya ba attributs ya ba données to JavaScript. Mpo na ba attributs ya ba données, bakisa kombo ya option na data-
, lokola na data-offset=""
.
Nkombo | lolenge | mbeba | ndimbola |
---|---|---|---|
offset ya kosala | nimero | 10 | Ba pixels ya ko offset depuis likolo tango ya ko calculer position ya défilement. |
Lolenge ya likambo | Ndimbola |
---|---|
kosala.bs.srollspy na mosala | Evenement oyo ezo beta chaque fois que eloko ya sika ekomi activé na scrollspy. |
Bakisa fonctionnalité ya tab ya mbangu, dynamique mpo na transition na nzela ya ba panneaux ya contenus local, ata na nzela ya ba menus déroulants. Ba onglets encastrés esimbami te.
Denim cru mbala mosusu oyoki bango te ba jean shorts Austin. Nesciunt tofu stumptown aliqua, bopeto ya masta ya synth rétro. Cliché ya moustache tempor, williamsburg carles helvetica ya vegan. Reprehenderit boucher rétro keffiyeh synth ya kokanga ndoto. Pull ya cosby eu banh mi, qui irure terry richardson ex calmar. Aliquip placeat salvia cillum na iphone. Seitan aliquip quis cardigan bilamba ya américain, boucher 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.
Plugin oyo ebakisaka eteni ya navigation oyo ezali na ba onglets mpo na kobakisa bisika oyo ezali na ba onglets.
Activer ba onglets ya ba tabbables na nzela ya JavaScript (onglet moko na moko esengeli ko activer yango moko):
Okoki ko activer ba onglets moko moko na ba façons ebele:
Okoki ko activer navigation ya onglet to ya pilili sans kokoma JavaScript moko te na ko préciser kaka data-toggle="tab"
to data-toggle="pill"
na élément moko. Kobakisa ba classes ya nav
mpe nav-tabs
na tab ul
ekosalela styling ya tab Bootstrap , nzokande kobakisa ba classes nav
mpe nav-pills
ekosalela styling ya pilili .
Mpo na kosala ete ba onglets esila, bakisá .fade
na mokomoko na yango .tab-pane
. Panneau ya onglet ya liboso esengeli mpe kozala .in
na kosala ete makambo ya ebandeli emonanaka.
$().tab
Ezali ko activer élément ya onglet na conteneur ya contenus. Onglet esengeli kozala na soit a soit data-target
un href
ciblant node ya conteneur na DOM. Na bandakisa oyo ezali likolo, ba onglets ezali ba <a>
s oyo ezali na ba data-toggle="tab"
attributs.
.tab('show')
Pona tab oyo epesami mpe elakisaka makambo oyo ezali na boyokani na yango. Onglet mosusu nyonso oyo eponami liboso ekómaka oyo eponami te mpe makambo oyo etali yango ebombamaka. Ezongi na mobengi yambo ete esika ya tab elakisama mpenza (elingi koloba liboso ete shown.bs.tab
likambo esalema).
Ntango ozali kolakisa tab ya sika, makambo yango ekobeta na molɔngɔ oyo elandi:
hide.bs.tab
(na tab oyo ezali kosala lelo)show.bs.tab
(na tab oyo esengeli kolakisa)hidden.bs.tab
(na onglet actif ya liboso, ndenge moko na oyo ya hide.bs.tab
événement)shown.bs.tab
(na tab oyo euti kolakisa sika oyo ezali kosala sika, ndenge moko na oyo ya show.bs.tab
likambo yango)Soki onglet moko te ezalaki déjà activé, alors ba événements hide.bs.tab
mpe hidden.bs.tab
ekobeta te.
Lolenge ya likambo | Ndimbola |
---|---|
lakisa.bs.tab | Evenement oyo ezo beta na tab show, mais avant onglet ya sika elakisama. Salelá event.target mpe mpo na event.relatedTarget ko cibler onglet active mpe onglet active ya kala (soki ezali) respectivement. |
elakisami.bs.tab | Evenement oyo ezo beta na tab show sima ya tab moko elakisama. Salelá event.target mpe mpo na event.relatedTarget ko cibler onglet active mpe onglet active ya kala (soki ezali) respectivement. |
bomba.bs.tab | Evenement oyo ezo beta tango onglet ya sika esengeli kolakisa (et donc onglet actif ya kala esengeli kobombama). Salelá event.target mpe event.relatedTarget mpo na kopesa motuya na tab oyo ezali kosala sikoyo mpe onglet ya sika oyo ekosalema kala mingi te, na kolanda. |
ebombami.bs.tab | Evenement oyo ezo beta sima ya onglet ya sika elakisami (mpe bongo onglet actif ya kala ebombami). Salelá event.target mpe mpo na event.relatedTarget ko cibler onglet active ya kala mpe onglet active ya sika, respectivement. |
Inspiré na plugin ya malamu mpenza ya jQuery.tipsy oyo ekomami na Jason Frame; Tooltips ezali version ya sika, oyo etie motema na bilili te, esalela CSS3 mpo na ba animations, mpe ba data-attributs mpo na kobomba titre ya esika.
Ba toli ya bisaleli oyo ezali na mitó ya makambo ya bolai zéro emonisami ata mokolo moko te.
Botia maboko na ba liens oyo ezali awa na se mpo na komona ba toli ya bisaleli:
Pantalon serré niveau prochain keffiyeh probablement oyoki bango te. Photo cabine mandefu brut denim tipskrit sac messenger vegan stumptown. Ferme-à-mesa seitan, mcsweeney ya fixie durable quinoa 8-bit bilamba ya américain bazali na terry richardson vinyl chambray. Mandefu stumptown, cardigans banh mi lomo ba mbwa ya nkake. Tofu biodiesel williamsburg marfa, minei loko mcsweeney ya kosukola chambray vegan. Un vraiment artisan ironique quelque soit keytar , scenester ferme-à-mesa banksy Austin twitter manche freegan cred cru denim café d'origine unique viral.
Ba options minei ezali: likolo, droite, na se, mpe gauche aligné.
Mpo na bantina ya bosali, Tooltip mpe Popover data-apis ezali opt-in, elingi koloba osengeli ko initialiser yango yo moko .
Lolenge moko ya ko initialiser ba toli nionso ya bisaleli na lokasa moko ekozala ya kopona yango na data-toggle
attribut na yango:
Plugin ya tooltip ebimisaka contenus mpe marquage na demande, mpe par défaut etie ba tooltip sima ya élément ya déclencheur na bango.
Déclenchez tooltip na nzela ya JavaScript:
Marquage oyo esengeli mpo na tooltip ezali kaka data
attribut mpe title
na élément HTML olingi kozala na tooltip. Marquage oyo esalemi ya tooltip ezali plutôt simple, atako esengaka position (par défaut, etiamaki na top
na plugin).
Tango mosusu olingi kobakisa toli ya bisaleli na hyperlien oyo ezo envelopper ba lignes ebele. Comportement par défaut ya plugin ya tooltip ezali ya ko centrer yango horizontalement na verticalement. Bakisa white-space: nowrap;
na ba ancres na yo po o éviter likambo oyo.
Ntango ozali kosalela makanisi ya bisaleli na biloko oyo ezali na kati ya a .btn-group
to an .input-group
, to na biloko oyo etali tableau ( <td>
, <th>
, <tr>
, <thead>
, <tbody>
, <tfoot>
), ekosɛnga oyebisa nzela container: 'body'
(ekomami awa na nse) mpo na koboya ba effets secondaires oyo olingi te (lokola eleman oyo ezali kokola mingi mpe/ to kobungisa ba coins na yango oyo ezali rond ntango nsɔngɛ ya bisaleli ebandi).
Mpo na basaleli oyo bazali kotambola na klaviatware, mpe mingimingi basaleli ya mayele ya kosalisa, osengeli kaka kobakisa makanisi ya bisaleli na biloko oyo ekoki kotya likebi na klaviatware lokola ba liens, ba contrôles ya formulaire, to eloko nyonso oyo ezali na tabindex="0"
attribut.
Mpo na kobakisa tooltip na a disabled
to .disabled
élément, tia élément na kati ya a <div>
mpe salela tooltip na yango na <div>
esika na yango.
Ba options ekoki koleka na nzela ya ba attributs ya ba données to JavaScript. Mpo na ba attributs ya ba données, bakisa kombo ya option na data-
, lokola na data-animation=""
.
Nkombo | Lolenge | Mbeba | Ndimbola |
---|---|---|---|
animation ya kosala | boolean | ya solo | Salelá transition ya fade ya CSS na tooltip |
eloko oyo batyaka na kati | molongo ya molongo | lokuta | lokuta | Ebakisi toli ya bisaleli na eloko moko ya sikisiki. Ndakisa: |
kozelisa | motango | moto ya likambo | 0. | Retard ya kolakisa pe kobomba tooltip (ms) - etali te lolenge ya déclencheur manuel Soki nimero moko epesami, retard esalemi na nyonso mibale kobomba/lakisa Bokeli ya eloko ezali: |
html | boolean | lokuta | Kotisa HTML na kati ya tooltip. Soki lokuta, méthode ya jQuery text ekosalelama mpo na kokotisa makambo na DOM. Salelá makomi soki ozali komitungisa mpo na ba attaques ya XSS. |
esika ya kotya yango | molongo ya molongo | mosala | 'likolo' | Ndenge nini ko positionner tooltip - likolo | na nse | na gauche | droite | auto. Tango fonction esalelami pona koyeba placement, ebengami na node DOM ya tooltip lokola argument na yango ya liboso mpe node DOM ya élément déclencheur lokola ya mibale na yango. Contexte |
moponi | shene | lokuta | Soki moponi epesami, biloko ya tooltip ekopesama na ba cibles oyo elakisami. Na misala, yango esalelamaka mpo na kopesa nzela na makambo ya HTML oyo ezali na bomoi mpo na kozala na bilembo ya bisaleli oyo ebakisami. Talá oyo mpe ndakisa moko oyo ezali kopesa makambo mingi . |
modèle ya kosala | shene | '<div class="tooltip" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>' |
Base HTML ya kosalela tango ya kosala tooltip. Ba tooltip's
Elemento ya enveloppe ya libanda esengeli kozala na |
titre | molongo ya molongo | mosala | '' . | Valeur ya titre par défaut soki Soki fonction epesami, ekobenga yango na |
kobandisa | shene | 'hover focus'. | Ndenge nini tooltip ebandi - finá | kosala hover | focus | mokanda. Okoki koleka ba déclencheur ebele; kokabola bango na esika moko. manual ekoki kosangisama te na déclencheur mosusu. |
esika ya kotala | molongo ya molongo | eloko | mosala | { moponi: 'nzoto', padding: 0 } | Ebatelaka tooltip na kati ya ndelo ya élément oyo. Ndakisa: Soki fonction epesami, ebengami na node DOM ya élément déclencheur lokola argument na yango seul. Contexte |
Ba options pona ba toli ya bisaleli moko moko ekoki na ndenge mosusu kozala précisé na nzela ya bosaleli ya ba attributs ya ba données, ndenge elimbolami likolo.
$().tooltip(options)
Ezali kokangisa mosaleli ya tooltip na liboke ya biloko.
.tooltip('show')
Ezali kobimisa tooltip ya élément moko. Ezongi na mobengi yambo ete tooltip elakisama mpenza (elingi koloba liboso ete shown.bs.tooltip
likambo esalema). Yango etalelami lokola déclenchement "manuel" ya tooltip. Ba toli ya bisaleli oyo ezali na mitó ya makambo ya bolai zéro emonisami ata mokolo moko te.
.tooltip('hide')
Ebombaka tooltip ya élément moko. Ezongi na mobengi yambo ete tooltip ebombama mpenza (elingi koloba liboso ete hidden.bs.tooltip
likambo esalema). Yango etalelami lokola déclenchement "manuel" ya tooltip.
.tooltip('toggle')
Ezali kobongola toggle ya tooltip ya élément moko. Ezongi na mobengi yambo ete toli ya bisaleli elakisama to ebombama mpenza (elingi koloba liboso ete likambo shown.bs.tooltip
to hidden.bs.tooltip
esalema). Yango etalelami lokola déclenchement "manuel" ya tooltip.
.tooltip('destroy')
Ebombaka mpe ebebisaka tooltip ya élément moko. Ba toli ya bisaleli oyo esalela délégation (oyo esalemi na kosalelaka option selector
) ekoki kobebisama moko moko te na ba éléments déclencheur descendant.
Lolenge ya likambo | Ndimbola |
---|---|
kolakisa.bs.toli ya bisaleli | Evenement oyo ezo beta mbala moko tango show méthode ya instance ebengami. |
oyo elakisami.bs.tooltip | Evenement oyo ezo beta tango tooltip esalemi komonana na mosaleli (ekozela ba transitions ya CSS esila). |
bomba.bs.likambo ya bisaleli | Evenement oyo ezo beta mbala moko tango hide méthode ya instance ebengami. |
ebombami.bs.tooltip ya bisaleli | Evenement oyo ezo beta tango tooltip esili kobombama na mosaleli (ekozela ba transitions ya CSS esila). |
ekotisami.bs.tooltip ya bisaleli | Evenement oyo ezo beta sima ya show.bs.tooltip événement tango modèle ya tooltip ebakisami na DOM. |
Bakisa ba superpositions ya mike ya contenus, lokola oyo ezali na iPad, na élément nionso pona ko loger ba informations secondaires.
Ba Popovers oyo titre na yango na contenus na yango ezali na bolai ya zéro elakisami jamais.
Popovers esengaka plugin ya tooltip ezala na kati ya version na yo ya Bootstrap.
Mpo na bantina ya bosali, Tooltip mpe Popover data-apis ezali opt-in, elingi koloba osengeli ko initialiser yango yo moko .
Lolenge moko ya ko initialiser ba popovers nionso na page moko ekozala pona yango na data-toggle
attribut na yango:
Ntango ozali kosalela ba popovers na ba éléments oyo ezali na kati ya a .btn-group
to an .input-group
, to na ba éléments oyo etali tableau ( <td>
, <th>
, <tr>
, <thead>
, <tbody>
, <tfoot>
), ekosengela oyebisa option container: 'body'
(ekomami awa na se) mpo na koboya ba effets secondaires oyo olingi te (lokola élément oyo ezali kokola mingi mpe/ to kobungisa ba coins na yango ya rond ntango popover ebandi).
Mpo na kobakisa popover na a disabled
to .disabled
élément, tia élément na kati ya a <div>
mpe pakola popover na yango na <div>
esika na yango.
Tango mosusu olingi kobakisa popover na hyperlien oyo ezo envelopper ba lignes ebele. Comportement par défaut ya plugin ya popover ezali ya ko centrer yango horizontalement na verticalement. Bakisa white-space: nowrap;
na ba ancres na yo po o éviter likambo oyo.
Ba options minei ezali: likolo, droite, na se, mpe gauche aligné.
Sed posuere consectetur est na lobortis. Aenean eu leo quam. Ornare péllentesque sem lacinia quam venenatis vestibulum.
Sed posuere consectetur est na lobortis. Aenean eu leo quam. Ornare péllentesque sem lacinia quam venenatis vestibulum.
Sed posuere consectetur est na lobortis. Aenean eu leo quam. Ornare péllentesque sem lacinia quam venenatis vestibulum.
Sed posuere consectetur est na lobortis. Aenean eu leo quam. Ornare péllentesque sem lacinia quam venenatis vestibulum.
Salelá focus
déclencheur mpo na koboya ba popovers na clic oyo elandi oyo mosaleli azali kosala.
Mpo na bizaleli malamu ya croix-navigateur mpe cross-plateforme, osengeli kosalela <a>
tag, tag te , <button>
mpe osengeli mpe kotia ba attributs role="button"
mpe .tabindex
Bofungola ba popovers na nzela ya JavaScript:
Ba options ekoki koleka na nzela ya ba attributs ya ba données to JavaScript. Mpo na ba attributs ya ba données, bakisa kombo ya option na data-
, lokola na data-animation=""
.
Nkombo | Lolenge | Mbeba | Ndimbola |
---|---|---|---|
animation ya kosala | boolean | ya solo | Salelá transition ya fade ya CSS na popover |
eloko oyo batyaka na kati | molongo ya molongo | lokuta | lokuta | Ebakisi popover na élément moko ya sikisiki. Ndakisa: |
makambo eza na kati | molongo ya molongo | mosala | '' . | Valeur ya contenus par défaut soki Soki fonction moko epesami, ekobenga yango na |
kozelisa | motango | moto ya likambo | 0. | Retard ya kolakisa pe kobomba popover (ms) - etali te type ya déclencheur manuel Soki nimero moko epesami, retard esalemi na nyonso mibale kobomba/lakisa Bokeli ya eloko ezali: |
html | boolean | lokuta | Kotisa HTML na kati ya popover. Soki lokuta, méthode ya jQuery text ekosalelama mpo na kokotisa makambo na DOM. Salelá makomi soki ozali komitungisa mpo na ba attaques ya XSS. |
esika ya kotya yango | molongo ya molongo | mosala | 'malamu' | Ndenge nini ko positionner popover - likolo | na nse | na gauche | droite | auto. Tango fonction esalelami pona koyeba placement, ebengami na node popover DOM lokola argument na yango ya liboso pe élément déclencheur node DOM lokola ya mibale na yango. Contexte |
moponi | shene | lokuta | Soki moponi epesami, biloko ya popover ekopesama na ba cibles oyo elakisami. Na pratique, yango esalelamaka pona ko permettre ba contenus HTML dynamiques ezala na ba popovers oyo ebakisami. Talá oyo mpe ndakisa moko oyo ezali kopesa makambo mingi . |
modèle ya kosala | shene | '<div class="popover" role="tooltip"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content"></div></div>' |
Base HTML ya kosalela tango ya kosala popover. Ba popover's Ba popover's
Elemento ya enveloppe ya libanda esengeli kozala na |
titre | molongo ya molongo | mosala | '' . | Valeur ya titre par défaut soki Soki fonction moko epesami, ekobenga yango na |
kobandisa | shene | 'cliquez'. | Ndenge nini popover ebandi - finá | kosala hover | focus | mokanda. Okoki koleka ba déclencheur ebele; kokabola bango na esika moko. manual ekoki kosangisama te na déclencheur mosusu. |
esika ya kotala | molongo ya molongo | eloko | mosala | { moponi: 'nzoto', padding: 0 } | Ezali kobatela popover na kati ya ndelo ya élément oyo. Ndakisa: Soki fonction epesami, ebengami na node DOM ya élément déclencheur lokola argument na yango seul. Contexte |
Ba options pona ba popovers moko moko ekoki na ndenge mosusu kozala précisé na nzela ya bosaleli ba attributs ya ba données, ndenge elimbolami likolo.
$().popover(options)
Initialise ba popovers pona collection ya élément.
.popover('show')
Ezali kobimisa popover ya élément moko. Ezongi na mobengi yambo popover elakisama mpenza (elingi koloba liboso ete shown.bs.popover
likambo esalema). Yango etalelami lokola déclenchement "manuel" ya popover. Ba Popovers oyo titre na yango na contenus na yango ezali na bolai ya zéro elakisami jamais.
.popover('hide')
Ebombaka popover ya élément moko. Ezongi na mobengi yambo ete popover ebombama mpenza (elingi koloba liboso ete hidden.bs.popover
likambo esalema). Yango etalelami lokola déclenchement "manuel" ya popover.
.popover('toggle')
Toggles popover ya élément moko. Ezongi na mobengi yambo popover elakisama to ebombama mpenza (elingi koloba yambo ete likambo shown.bs.popover
to hidden.bs.popover
esalema). Yango etalelami lokola déclenchement "manuel" ya popover.
.popover('destroy')
Ebombaka mpe ebebisaka popover ya élément moko. Popovers oyo esalela délégation (oyo esalemi na nzela ya selector
option ) ekoki kobebisama moko moko te na ba éléments déclencheur descendant.
Lolenge ya likambo | Ndimbola |
---|---|
elakisaka.bs.popover | Evenement oyo ezo beta mbala moko tango show méthode ya instance ebengami. |
elakisami.bs.bobola | Evenement oyo ezo beta tango popover esalemi visible na mosaleli (ekozela ba transitions ya CSS esila). |
bomba.bs.bobola | Evenement oyo ezo beta mbala moko tango hide méthode ya instance ebengami. |
ebombami.bs.bobola | Evenement oyo ezo beta tango popover esili kobombama na mosaleli (ekozela ba transitions ya CSS esila). |
ekotisami.bs.bobola | Evenement oyo ezo bengana sima ya show.bs.popover événement tango modèle ya popover ebakisami na DOM. |
Bakisa fonctionnalité ya démission na ba messages nionso ya alerte na plugin oyo.
Ntango ozali kosalela .close
bouton, esengeli kozala mwana ya liboso ya .alert-dismissible
mpe eloko moko te ya makomi ekoki koya liboso na yango na elembo.
Bobongola oyo mpe oyo mpe meká lisusu. Duis mollis, est non commodo luctus, nisi erat ligula ya porte, eget lacinia odio sem nec elit. Cras mattis consectetur purus efandaka na fermentum.
Bakisa kaka data-dismiss="alert"
na bouton na yo ya kokanga mpo na kopesa automatiquement fonctionnalité ya kokanga alerte. Kokanga alerte elongolaka yango na DOM.
Mpo na kosala ete ba alertes na yo esalela animation ntango ozali kokanga, sala ete ezala na .fade
mpe.in
classes ya pe esi esalemi na bango
$().alert()
Esalaka alerte koyoka ba événements ya clic na ba éléments descendants oyo ezali na data-dismiss="alert"
attribut. (Ezali na ntina te ntango ozali kosalela auto-initialisation ya data-api.)
$().alert('close')
Ekangaka alerte na kolongola yango na DOM. Soki ba classes .fade
mpe .in
ezali na élément, alerte ekosila liboso ya kolongola yango.
Plugin ya alerte ya Bootstrap e exposer mua ba événements pona ko crochet na fonctionnalité ya alerte.
Lolenge ya likambo | Ndimbola |
---|---|
bokanga.bs.alerte | Evenement oyo ezo beta mbala moko tango close méthode ya instance ebengami. |
ekangami.bs.alerte | Evenement oyo ezo beta tango alerte ekangami (ekozela ba transitions ya CSS esila). |
Sala mingi na ba boutons. Bouton ya contrôle ezo loba to kosala ba groupes ya ba boutons pona ba composants ebele lokola ba barres d'outils.
Firefox ewumeli na ba états ya contrôle ya formulaire (disabledness mpe checkedness) na kati ya ba charges ya page . Likambo ya kosilisa likambo yango ezali ya kosalela autocomplete="off"
. Tala likambo ya Mozilla #654072 .
Bakisa data-loading-text="Loading..."
mpo na kosalela état ya chargement na bouton moko.
Ezaleli oyo ezali déprecated banda v3.3.5 mpe elongolami na v4.
Mpo na bolamu ya elakiseli oyo, tozali kosalela data-loading-text
mpe $().button('loading')
, kasi yango ezali kaka te etuka oyo okoki kosalela. Tala makambo mingi na ntina ya likambo oyo na nse na $().button(string)
mikanda .
Bakisa data-toggle="button"
mpo na ko activer toggling na bouton moko.
.active
mpearia-pressed="true"
Mpo na ba boutons pré-togglé, esengeli obakisa .active
classe mpe aria-pressed="true"
attribut na button
yo moko.
Bakisa data-toggle="buttons"
na .btn-group
case ya kotiya elembo oyo ezali na to ba entrées ya radio mpo na ko permettre toggling na ba styles na bango respectifs.
.active
Mpo na ba options oyo oponi liboso, esengeli obakisa .active
kelasi na oyo ya entrée label
yo moko.
Soki état marqué ya bouton ya case ya kotiya elembo ezali mise à jour sans ko tirer click
événement na bouton (par exemple via <input type="reset">
ou via setting la checked
propriété ya entrée), ekosenga o changer .active
classe na entrée's label
yo moko.
$().button('toggle')
Toggles état ya kopusama. Epesaka bouton apparence que esili ko activer.
$().button('reset')
Ezongisaka état ya bouton - ebongoli makomi na makomi ya ebandeli. Méthode oyo ezali asynchrone mpe ezongaka avant réinitialisation esila vraiment.
$().button(string)
Echanger texte na état nionso ya texte oyo e définir na ba données.
Plugin flexible oyo esalelaka mwa ba classes pona comportement ya toggle facile.
Collapse esengaka plugin ya ba transitions ezala na version na yo ya Bootstrap.
Finá na ba boutons oyo ezali awa na nse mpo na kolakisa mpe kobomba eloko mosusu na nzela ya mbongwana ya kelasi:
.collapse
ebombaka makambo oyo ezali na kati.collapsing
esalelamaka na ntango ya mbongwana.collapse.in
elakisaka makambo oyo ezali na katiOkoki kosalela lien oyo ezali na href
attribut, to bouton oyo ezali na data-target
attribut. Na makambo nyonso mibale, data-toggle="collapse"
esɛngami.
Bobakisa comportement ya collapse par défaut mpo na kosala accordéon na composant ya panneau.
Ezali mpe possible ko swap out .panel-body
s na .list-group
s.
Bozala sûr ya kobakisa aria-expanded
na élément ya contrôle. Attribut oyo e définir explicitement état actuel ya élément collapsible na ba lecteurs d'écran na ba technologies d'assistance ya ndenge wana. Soki eloko oyo ekoki kokangama ekangami na ndenge ya libela, esengeli kozala na motuya ya aria-expanded="false"
. Soki otie élément collapsible ezala ouvert par défaut kosalela in
classe, tia aria-expanded="true"
na contrôle na esika na yango. Plugin eko changer automatiquement attribut oyo selon soki élément collapsible efungolami to ekangami to te.
En plus, soki élément ya contrôle na yo ezali ko cibler élément moko collapsible – c’est-à-dire data-target
attribut ezali ko pointer na id
sélecteur – okoki kobakisa aria-controls
attribut supplémentaire na élément de contrôle, oyo ezali na id
ya élément collapsible. Ba lecteurs d’écran ya mikolo oyo mpe ba technologies ya assistance ya ndenge wana esalelaka attribut oyo mpo na kopesa ba usagers ba raccourcis ya kobakisa mpo na ko naviguer directement na élément collapsible yango moko.
Plugin ya collapse esalelaka mua ba classes pona ko gérer levage ya kilo:
.collapse
ebombaka makambo oyo ezali na kati.collapse.in
elakisaka makambo oyo ezali na kati.collapsing
ebakisami ntango mbongwana ebandi, mpe elongolami ntango esiliBakelasi yango ekoki kozwama na component-animations.less
.
Bakisa kaka data-toggle="collapse"
na a data-target
na élément pona ko assigner automatiquement contrôle ya élément collapsible. Attribut data-target
endimi moponi ya CSS mpo na kosalela collapse na yango. Bozala sûr ya kobakisa classe collapse
na élément collapsible. Soki olingi ete efungwama na ndenge ya liboso, bakisá kelasi ya kobakisa in
.
Mpo na kobakisa boyangeli ya etuluku lokola accordéon na contrôle collapsible, bakisa attribut ya ba données data-parent="#selector"
. Tala démonstration po omona likambo oyo na action.
Activer manuellement na:
Ba options ekoki koleka na nzela ya ba attributs ya ba données to JavaScript. Mpo na ba attributs ya ba données, bakisa kombo ya option na data-
, lokola na data-parent=""
.
Nkombo | lolenge | mbeba | ndimbola |
---|---|---|---|
moboti | moponi | lokuta | Soki moponi epesami, boye biloko nyonso oyo ekoki kokangama na nse ya moboti oyo elakisami ekokangama ntango eloko oyo ekoki kokangama ekolakisama. (ekokani na bizaleli ya bonkoko ya accordéon - yango etali panel kelasi) |
kobongola makambo | boolean | ya solo | Ebalusaka élément collapsible na invocation |
.collapse(options)
Active contenus na yo lokola élément collapsible. Andimi ba options moko ya option object
.
.collapse('toggle')
Ezali kobongola eloko oyo ekoki kokangama mpo na kolakisa to kobombama. Ezongi na mobengi yambo ete eloko oyo ekoki kokangama ezala mpenza kolakisa to ebombama (elingi koloba liboso ete likambo shown.bs.collapse
to hidden.bs.collapse
esalema).
.collapse('show')
Ezali kolakisa eleman moko oyo ekoki kokangama. Ezongisaka na mobengi yambo ete eloko oyo ekoki kokangama elakisama mpenza (elingi koloba liboso ete shown.bs.collapse
likambo esalema).
.collapse('hide')
Ebombaka eloko moko oyo ekoki kokangama. Ezongi na mobengi yambo ete eloko oyo ekoki kokangama ebombama mpenza (elingi koloba liboso ete hidden.bs.collapse
likambo esalema).
Classe ya collapse ya Bootstrap e exposer mua ba événements pona ko crochet na fonctionnalité ya collapse.
Lolenge ya likambo | Ndimbola |
---|---|
elakiseli.bs.kokwea | Evenement oyo ezo beta mbala moko tango show méthode ya instance ebengami. |
elakisami.bs.kokwea | Evenement oyo ezo beta tango élément ya collapse esalemi visible na mosaleli (ekozela ba transitions ya CSS esila). |
kobomba.bs.kokwea | Evenement oyo ebetamaka mbala moko tango hide méthode ebengami. |
ebombami.bs.kokwea | Evenement oyo ezo beta tango élément ya collapse ebombami na mosaleli (ekozela ba transitions ya CSS esila). |
Composant ya diaporama mpo na kokende na velo na kati ya ba éléments, lokola carrousel. Ba carousels encadrés esimbami te.
Composante ya carrousel ezali généralement na boyokani te na ba normes ya accessibilité. Soki osengeli kotosa mibeko, tosɛngi yo otalela makambo mosusu oyo okoki kosala mpo na kolakisa makambo na yo.
Bootstrap esalelaka kaka CSS3 mpo na ba animations na yango, kasi Internet Explorer 8 & 9 esimbaka te ba propriétés ya CSS oyo esengeli. Na yango, ezali na ba animations ya transition ya diapositive te tango ozali kosalela ba navigateurs wana. Tozwi mokano na mokano ya kokɔtisa te ba fallbacks oyo esalemi na jQuery mpo na ba transitions.
Esengeli .active
kobakisa kelasi na moko ya ba diapositives. Soki te, carousel ekozala komonana te.
Ba classes .glyphicon .glyphicon-chevron-left
na .glyphicon .glyphicon-chevron-right
ezali forcément te na besoin pona ba contrôles. Bootstrap epesaka .icon-prev
mpe .icon-next
lokola ba alternatives ya unicode ya pamba.
Bakisa ba captions na ba diapositives na yo facilement na .carousel-caption
élément na kati ya nionso .item
. Tia kaka pene na HTML nionso ya option na kati kuna mpe ekozala automatiquement aligné mpe formaté.
Ba carousel esengaka kosalela an id
na récipient ya libanda mingi (le .carousel
) mpo ba contrôles ya carousel esala malamu. Ntango ozali kobakisa ba carousel ebele, to ntango ozali kobongola oyo ya carousel id
, kobosana te kosala mikolo oyo ba contrôles oyo etali yango.
Salelá ba attributs ya ba données mpo na ko contrôler facilement position ya carrousel. data-slide
endimaka maloba ya ntina prev
to next
, oyo ebongoli esika ya diapositive na kotalela esika oyo ezali sikoyo. Na lolenge mosusu, salelá data-slide-to
mpo na koleka index ya diapositive brut na carousel data-slide-to="2"
, oyo ebongoli esika ya diapositive na index moko boye oyo ebandi na 0
.
Attribut data-ride="carousel"
esalelamaka mpo na kotya elembo na carousel lokola animateur kobanda na chargement ya lokasa. Ekoki kosalelama te elongo na (redundante mpe oyo ezali na ntina te) initialisation explicite ya JavaScript ya carousel moko.
Benga carousel na maboko na:
Ba options ekoki koleka na nzela ya ba attributs ya ba données to JavaScript. Mpo na ba attributs ya ba données, bakisa kombo ya option na data-
, lokola na data-interval=""
.
Nkombo | lolenge | mbeba | ndimbola |
---|---|---|---|
intervalle ya kosala | nimero | 5000 ya bato | Motango ya ntango oyo esengeli kozongisa nsima kati na kotambola na velo na eloko moko na ndenge ya automatique. Soki lokuta, carrousel ekosala cycle automatiquement te. |
kopema | molongo ya molongo | ntina te | "kosala hover". | Soki otie yango na "hover" , ezo pause na cycle ya carrousel na mouseenter pe ezongelaka cycle ya carousel na mouseleave . Soki otye yango na null , kopumbwa likoló ya carousel ekopemisa yango te. |
kokanga | boolean | ya solo | Ezala carrousel esengeli kosala cycle continuellement to kozala na ba arrêts ya makasi. |
clavier ya kosala | boolean | ya solo | Soki carousel esengeli e réagir na ba événements ya clavier. |
.carousel(options)
Initialiser carrousel na options optionnelles object
mpe abandi ko cycler na nzela ya biloko.
.carousel('cycle')
Ezali kosala cycle na kati ya biloko ya carrousel kobanda na lobɔkɔ ya mwasi tii na lobɔkɔ ya mobali.
.carousel('pause')
Epekisaka carrousel ekende na velo na nzela ya biloko.
.carousel(number)
Ezali kosala cycle ya carousel na cadre moko boye (0 basé, ndenge moko na array).
.carousel('prev')
Ba cycles na eloko oyo eleki.
.carousel('next')
Ezali kosala ba cycles tii na eloko oyo elandi.
Classe ya carrousel ya Bootstrap e exposer deux événements pona ko crochet na fonctionnalité ya carrousel.
Ba événements nionso mibale ezali na ba propriétés ya kobakisa oyo elandi:
direction
: Nzela oyo carrousel ezali kogumbama (soit "left"
to "right"
).relatedTarget
: Elemento ya DOM oyo ezali ko glisser na esika lokola eloko ya active.Ba événements nionso ya carrousel ebetamaka na carrousel yango moko (c.a.d. na <div class="carousel">
).
Lolenge ya likambo | Ndimbola |
---|---|
diapositive.bs.carousel ya kosala | Evenement oyo ezo beta mbala moko tango slide méthode ya instance ezo invoquer. |
glissement.bs.carousel ya kosala | Evenement oyo ebetamaka tango carrousel esili kosala transition na yango ya diapositive. |
Plugin ya affixe efungolaka position: fixed;
mpe ekangamaka, emulaka effet oyo ezwami na position: sticky;
. Sous-navigation oyo ezali na droite ezali démonstration en direct ya plugin ya affix.
Salelá plugin ya affix na nzela ya ba attributs ya ba données to manuellement na JavaScript na yo moko. Na ba situations nionso mibale, esengeli opesa CSS pona positionnement na largeur ya contenus na yo oyo ekangami.
Liyebisi: Kosalela te plugin ya affix na élément oyo ezali na kati ya élément oyo ezali relativement positionné, lokola colonne oyo ebendami to oyo epusami, mpo na bug ya rendu ya Safari .
Plugin ya affixe ebalukaka kati na bakelasi misato, moko na moko ezali komonisa ezalela moko boye: .affix
, .affix-top
, mpe .affix-bottom
. Esengeli opesa ba styles, longola kaka position: fixed;
on .affix
, mpo na ba classes oyo yo moko (indépendant ya plugin oyo) mpo na ko gérer ba positions ya solo.
Tala ndenge plugin ya affix esalaka:
.affix-top
mpo na kolakisa ete eloko yango ezali na esika na yango ya likoló mpenza. Na esika oyo positionnement ya CSS esengeli te..affix
ezo remplacer .affix-top
pe ezo set position: fixed;
(epesami na CSS ya Bootstrap)..affix
na .affix-bottom
. Lokola ba offsets ezali optionnel, ko setting moko esengi yo o setting CSS oyo ebongi. Na likambo yango, bakisá position: absolute;
ntango esengeli. Plugin esalela attribut ya ba données to option JavaScript pona koyeba esika nini esengeli ko positionner élément depuis kuna.Landa ba étapes oyo ezali likolo pona ko setting CSS na yo pona moko ya ba options ya usage oyo ezali awa na se.
Pona kobakisa facilement comportement ya affix na élément nionso, bakisa kaka data-spy="affix"
na élément oyo olingi o espionner. Salelá ba offsets mpo na kolimbola ntango nini kobongola pinning ya eleman moko.
Benga plugin ya affix na nzela ya JavaScript:
Ba options ekoki koleka na nzela ya ba attributs ya ba données to JavaScript. Mpo na ba attributs ya ba données, bakisa kombo ya option na data-
, lokola na data-offset-top="200"
.
Nkombo | lolenge | mbeba | ndimbola |
---|---|---|---|
offset ya kosala | motango | mosala | moto ya likambo | 10 | Ba pixels ya ko décoller na écran tango ya ko calculer position ya défilement. Soki motángo moko epesami, offset ekosalema na ngámbo ya likoló mpe ya nse. Mpo na kopesa offset moko ya kokamwa, ya nse mpe ya likoló kopesa kaka eloko moko offset: { top: 10 } to offset: { top: 10, bottom: 5 } . Salelá fonction ntango osengeli kosala calcul dynamique ya offset. |
eloko bazokana | moponi | node | Elemento ya jQuery | window eloko yango |
Ezali kolakisa eleman ya cible ya affixe. |
.affix(options)
Active contenus na yo lokola contenus affixé. Andimi ba options moko ya option object
.
.affix('checkPosition')
Ezali kosala lisusu calcul ya état ya affixe na kotalela ba dimensions, position, mpe position ya défilement ya ba éléments oyo etali yango. Ba .affix
, .affix-top
, mpe .affix-bottom
bakelasi ebakisami to elongolami na makambo oyo ekangami engebene ezalela ya sika. Esengeli kobenga méthode oyo tango nionso ba dimensions ya contenus oyo ekangami to élément cible ebongwanaka, pona ko assurer positionnement correct ya contenus oyo ekangami.
Plugin ya affix ya Bootstrap e exposer mua ba événements pona ko crochet na fonctionnalité ya affix.
Lolenge ya likambo | Ndimbola |
---|---|
affix.bs.kokanga yango | Evenement oyo ezo beta mbala moko avant élément ezala fixé. |
ekangami.bs.affix | Evenement oyo ezo beta sima ya élément ezala fixé. |
affix-likolo.bs.affix | Evenement oyo ezo beta mbala moko avant élément ezala affixé-top. |
ekangami-likolo.bs.affix | Evenement oyo ezo beta sima ya élément ezala affixé-top. |
affix-na nse.bs.affix | Evenement oyo ezo beta mbala moko avant élément ezala affixé-bottom. |
ekɔtisami-na nse.bs.affix | Evenement oyo ezo beta sima ya élément ezala affixé-bottom. |