Navs
Mikanda mpe bandakisa mpo na ndenge ya kosalela biloko ya mobembo oyo ezali na kati ya Bootstrap.
Navigation oyo ezali na Bootstrap ekabolaka marquage général mpe ba styles, kobanda na .nav
classe ya base tii na ba états actifs mpe désactivés. Swap ba classes ya modificateur pona ko changer entre style moko na moko.
Composante ya base .nav
etongami na flexbox mpe epesaka fondation makasi mpo na kotonga ba composants ya navigation ya ndenge nionso. Ezali na mwa ba overrides ya style (mpo na kosala na ba liste), mwa padding ya lien mpo na ba zones ya hit ya minene, mpe styling ya base désactivé.
Composante ya base .nav
ezali na .active
état moko te. Ba exemples oyo elandi ezali na classe, surtout pona kolakisa que classe oyo particulière e déclencher ata styling moko ya spécial te.
<ul class="nav">
<li class="nav-item">
<a class="nav-link active" href="#">Active</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Link</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Link</a>
</li>
<li class="nav-item">
<a class="nav-link disabled" href="#">Disabled</a>
</li>
</ul>
Ba classes esalemaka na mobimba, donc marquage na yo ekoki kozala super flexible. Salelá <ul>
s lokola oyo ezali likoló, to rouler oyo ya yo moko na loba <nav>
élément moko. Po ba .nav
usages display: flex
, ba liens nav ezo comporter ndenge moko na ba éléments nav elingaki, mais sans marquage supplémentaire.
<nav class="nav">
<a class="nav-link active" href="#">Active</a>
<a class="nav-link" href="#">Link</a>
<a class="nav-link" href="#">Link</a>
<a class="nav-link disabled" href="#">Disabled</a>
</nav>
Bobongola style ya .nav
composant s na ba modificateurs na ba utilitaires. Sangisa mpe kosangisa soki esengeli, to tonga oyo ya yo moko.
Bobongola alignment horizontal ya nav na yo na ba utilitaires flexbox . Par défaut, ba navs ezali aligné na gauche, kasi okoki ko changer yango facilement na aligné na centre to na droite.
Ezali na centre na .justify-content-center
:
<ul class="nav justify-content-center">
<li class="nav-item">
<a class="nav-link active" href="#">Active</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Link</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Link</a>
</li>
<li class="nav-item">
<a class="nav-link disabled" href="#">Disabled</a>
</li>
</ul>
Ezali na boyokani na lobɔkɔ ya mobali na .justify-content-end
:
<ul class="nav justify-content-end">
<li class="nav-item">
<a class="nav-link active" href="#">Active</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Link</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Link</a>
</li>
<li class="nav-item">
<a class="nav-link disabled" href="#">Disabled</a>
</li>
</ul>
Stack navigation na yo na ko changer direction ya flex item na .flex-column
utilitaire. Besoin ya ko empiler bango na ba viewports mosusu mais misusu te? Salelá ba versions oyo ezo répondre (par exemple, .flex-sm-column
).
<ul class="nav flex-column">
<li class="nav-item">
<a class="nav-link active" href="#">Active</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Link</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Link</a>
</li>
<li class="nav-item">
<a class="nav-link disabled" href="#">Disabled</a>
</li>
</ul>
Comme toujours, navigation verticale ezali possible sans <ul>
s, trop.
<nav class="nav flex-column">
<a class="nav-link active" href="#">Active</a>
<a class="nav-link" href="#">Link</a>
<a class="nav-link" href="#">Link</a>
<a class="nav-link disabled" href="#">Disabled</a>
</nav>
Azuaka nav ya base na likolo pe abakisi .nav-tabs
classe pona ko produire interface ya onglet. Salelá yango mpo na kosala ba régions ya ba tabbables na plugin na biso ya JavaScript ya tab .
<ul class="nav nav-tabs">
<li class="nav-item">
<a class="nav-link active" href="#">Active</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Link</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Link</a>
</li>
<li class="nav-item">
<a class="nav-link disabled" href="#">Disabled</a>
</li>
</ul>
Zwá kaka HTML yango, kasi salelá .nav-pills
na esika na yango:
<ul class="nav nav-pills">
<li class="nav-item">
<a class="nav-link active" href="#">Active</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Link</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Link</a>
</li>
<li class="nav-item">
<a class="nav-link disabled" href="#">Disabled</a>
</li>
</ul>
Forcer .nav
ba contenus ya yo 's pona ko extend largeur mobimba oyo ezali moko ya ba classes mibale ya modificateur. Mpo na kotondisa na ndenge oyo ebongi bisika nyonso oyo ezali na .nav-item
s na yo, salelá .nav-fill
. Simbá ete esika nyonso ya horizontal ezali occupé, kasi eloko nyonso ya nav ezali na bonene ndenge moko te.
<ul class="nav nav-pills nav-fill">
<li class="nav-item">
<a class="nav-link active" href="#">Active</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Longer nav link</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Link</a>
</li>
<li class="nav-item">
<a class="nav-link disabled" href="#">Disabled</a>
</li>
</ul>
Ntango ozali kosalela <nav>
navigation oyo esalemi na -, kobosana te kotya yango .nav-item
na ba ancres.
<nav class="nav nav-pills nav-fill">
<a class="nav-item nav-link active" href="#">Active</a>
<a class="nav-item nav-link" href="#">Link</a>
<a class="nav-item nav-link" href="#">Link</a>
<a class="nav-item nav-link disabled" href="#">Disabled</a>
</nav>
Mpo na biloko oyo ezali na bonene ekokani, salelá .nav-justified
. Espace horizontal nionso ekozala occupé na ba liens nav, mais contrairement na oyo ya .nav-fill
likolo, eloko nionso ya nav ekozala na largeur moko.
<nav class="nav nav-pills nav-justified">
<a class="nav-link active" href="#">Active</a>
<a class="nav-link" href="#">Longer nav link</a>
<a class="nav-link" href="#">Link</a>
<a class="nav-link disabled" href="#">Disabled</a>
</nav>
Ndenge moko na .nav-fill
ndakisa oyo esalelaka <nav>
navigation -based, sala makasi otia .nav-item
na ba ancres.
<nav class="nav nav-pills nav-justified">
<a class="nav-item nav-link active" href="#">Active</a>
<a class="nav-item nav-link" href="#">Link</a>
<a class="nav-item nav-link" href="#">Link</a>
<a class="nav-item nav-link disabled" href="#">Disabled</a>
</nav>
Soki ozali na mposa ya ba variations nav oyo ezo répondre, kanisá kosalela série ya ba utilitaires ya flexbox . Atako ezali verbose mingi, ba utilitaires oyo epesaka personnalisation monene na kati ya ba points de rupture oyo ezo répondre. Na ndakisa oyo ezali awa na nse, nav na biso ekozala ebele na point de rupture ya nse, sima ko adapter na disposition horizontale oyo etondisaka largeur oyo ezali kobanda na point de rupture ya moke.
<nav class="nav nav-pills flex-column flex-sm-row">
<a class="flex-sm-fill text-sm-center nav-link active" href="#">Active</a>
<a class="flex-sm-fill text-sm-center nav-link" href="#">Link</a>
<a class="flex-sm-fill text-sm-center nav-link" href="#">Link</a>
<a class="flex-sm-fill text-sm-center nav-link disabled" href="#">Disabled</a>
</nav>
Soki ozali kosalela navs mpo na kopesa barre ya navigation, sala makasi obakisa a role="navigation"
na conteneur parent oyo ezali na logique mingi ya <ul>
, to envelopper <nav>
élément moko zingazinga ya navigation mobimba. Kobakisa te rôle na <ul>
yango moko, mpo yango ekopekisa yango esakolama lokola liste ya solosolo na ba technologies ya kosunga.
Yeba ete ba barres ya navigation, ata soki esalemi na ndenge ya komona lokola ba onglets na .nav-tabs
classe, esengeli te kopesama role="tablist"
, role="tab"
to role="tabpanel"
ba attributs. Yango ebongi kaka mpo na ba interfaces ya ba onglets dynamiques, ndenge elobami na WAI ARIA Authoring Practices . Tala bizaleli ya JavaScript mpo na ba interfaces ya ba onglets dynamiques na eteni oyo mpo na ndakisa.
Bakisa ba menu oyo ezali kokita na mwa HTML ya kobakisa mpe ba plugin ya JavaScript oyo ezali kokita .
<ul class="nav nav-tabs">
<li class="nav-item">
<a class="nav-link active" href="#">Active</a>
</li>
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" data-toggle="dropdown" href="#" role="button" aria-haspopup="true" aria-expanded="false">Dropdown</a>
<div class="dropdown-menu">
<a class="dropdown-item" href="#">Action</a>
<a class="dropdown-item" href="#">Another action</a>
<a class="dropdown-item" href="#">Something else here</a>
<div class="dropdown-divider"></div>
<a class="dropdown-item" href="#">Separated link</a>
</div>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Link</a>
</li>
<li class="nav-item">
<a class="nav-link disabled" href="#">Disabled</a>
</li>
</ul>
<ul class="nav nav-pills">
<li class="nav-item">
<a class="nav-link active" href="#">Active</a>
</li>
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" data-toggle="dropdown" href="#" role="button" aria-haspopup="true" aria-expanded="false">Dropdown</a>
<div class="dropdown-menu">
<a class="dropdown-item" href="#">Action</a>
<a class="dropdown-item" href="#">Another action</a>
<a class="dropdown-item" href="#">Something else here</a>
<div class="dropdown-divider"></div>
<a class="dropdown-item" href="#">Separated link</a>
</div>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Link</a>
</li>
<li class="nav-item">
<a class="nav-link disabled" href="#">Disabled</a>
</li>
</ul>
Salelá onglet plugin JavaScript —kotia yango mokomoko to na nzela ya bootstrap.js
fisyé oyo esangisi —mpo na koyeisa monene ba onglets mpe ba pilili na biso ya kotambwisa mpo na kosala ba panneaux ya tabbable ya makambo ya esika oyo ozali, ata na nzela ya ba menu oyo ezali kokita.
Soki ozali kotonga JavaScript na biso uta na source, esengiutil.js
.
Ba interfaces dynamiques ya ba onglets, ndenge elobami na WAI ARIA Authoring Practices , esengaka role="tablist"
, role="tab"
, role="tabpanel"
, mpe ba aria-
attributs ya kobakisa mpo na kopesa structure na yango, fonctionnalité mpe état actuel na basaleli ya ba technologies ya lisungi (lokola ba lecteurs d’écran).
Yeba ete ba interfaces onglets dynamiques esengeli te kozala na ba menu ya kokita, lokola yango epesaka mikakatano ya bosaleli mpe ya bozwi. Na perspective ya usabilité, le fait que élément déclencheur ya onglet oyo elakisami sikoyo emonanaka mbala moko te (lokola ezali na kati ya menu déroulant fermé) ekoki kosala confusion. Na point de vue ya accessibilité, ezali na tango oyo moyen sensible te ya kosala carte ya lolenge oyo ya construct na modèle standard WAI ARIA, elingi koloba ete ekoki te kozala facilement compréhensible na ba usagers ya ba technologies d’assistance.
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.
Mpo na kosalisa na kokokana na bamposa na yo, yango esalaka na <ul>
-basé na bilembo, lokola emonisami awa na likoló, to na bilembo nyonso ya “kobalusa ya yo moko” oyo esalemi na ndenge ya arbitraire. Yeba ete soki ozali kosalela <nav>
, osengeli te kobakisa role="tablist"
mbala moko na yango, mpamba te yango ekolongola mokumba ya mboka ya eleman lokola elembo ya botali. Na esika ya kosala bongo, bongola na eloko mosusu (na ndakisa oyo ezali awa na nse, moko ya pɛtɛɛ <div>
) mpe zingá yango <nav>
zingazinga na yango.
Plugin ya ba onglets esalaka pe na ba pilili.
Consequat occaecat ullamco amet non eiusmod nostrud dolore irure incididunt ezali na mokolo ya bomoi ya mokolo ya mosala. Fugiat velit proident aliquip nisi incididunt kosala ngalasisi ya nostrud proident est nisi. Irure magna elit commodo anim ex veniam culpa eiusmod id nostrud vandi cupidat na veniam ad. Eiusmod consequat eu adipisicing minim anima aliquip cupidatat culpa longola kaka quis. Occaecat vanda eu kosala ngalasisi irure Lorem incididunt nostrud.
Ad pariatur nostrud pariatur exercitation ipsum ipsum culpa mollit commodo mollit ex. Aute sunt incididunt amet commodo est sint nisi deserunt pariatur do. Aliquip ex eiusmod voluptate exercitation cillum id incididunt elit sunt. Qui minim sit magna Lorem id et dolore velit Lorem amet exercitation duis deserunt. Anim id labore elit adipisicing ut in id occaecat pariatur ut ullamco ea tempor duis.
Est quis nulla laborum officia ad nisi ex nostrud culpa Lorem excepteur aliquip dolor aliqua irure ex. Nulla ut duis ipsum nisi elit fugiat commodo sunt reprehenderit laborum veniam eu veniam. Eiusmod minim exercitation fugiat irure ex labore incididunt do fugiat commodo aliquip sit id deserunt reprehenderit aliquip nostrud. Amet ex cupidatat excepteur aute veniam incididunt mollit cupidatat esse irure officia elit do ipsum ullamco Lorem. Ullamco ut ad minim do mollit labore ipsum laboris ipsum commodo sunt tempor enim incididunt. Commodo quis sunt dolore aliquip aute tempor irure magna enim minim reprehenderit. Ullamco consectetur culpa veniam sint cillum aliqua incididunt velit ullamco sunt ullamco quis quis commodo voluptate. Mollit nulla nostrud adipisicing aliqua cupidatat aliqua pariatur mollit voluptate voluptate consequat non.
Mpe na bankisi oyo ezali semba.
Cillum ad ut irure tempor velit nostrud occaecat ullamco aliqua anim Lorem sint. Veniam sint duis incididunt kosala esse magna mollit longola kaka laborum qui. Id id reprehenderit kofanda est eu aliqua occaecat quis mpe velit longola kaka laborum mollit dolore eiusmod. Ipsum dolor na occaecat commodo mpe voluptate minimum reprehenderit mollit pariatur. Deserunt non laborum enim et cillum eu deserunt longola kaka incididunt minim occaecat.
Culpa dolor voluptate do laboris laboris irure reprehenderit id incididunt duis pariatur mollit aute magna pariatur consectetur. Eu veniam duis non ut dolor deserunt commodo et minim in quis laboris ipsum velit id veniam. Quis ut consectetur adipisicing officia excepteur non sit. Ut et elit aliquip labore Lorem enim eu. Ullamco mollit occaecat dolore ipsum id officia mollit qui esse anim eiusmod do sint minim consectetur qui.
Fugiat id quis dolor culpa eiusmod anim velit excepteur proident dolor aute qui magna. Ad proident laboris ullamco esse anim Lorem Lorem veniam quis Lorem irure occaecat velit nostrud magna nulla. Velit et et proident Lorem do ea tempor officia dolor. Reprehenderit Lorem aliquip labore est magna commodo est ea veniam consectetur.
Eu dolore ea ullamco dolore Lorem id cupidatat excepteur reprehenderit consectetur elit id dolor proident in cupidatat officia. Voluptate excepteur commodo labore nisi cillum duis aliqua do. Aliqua amet qui mollit consectetur nulla mollit velit aliqua veniam nisi id do Lorem deserunt amet. Culpa ullamco sit adipisicing labore officia magna elit nisi in aute tempor commodo eiusmod.
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. Salelá bizaleli oyo ya ba données na .nav-tabs
to .nav-pills
.
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:
Mpo na kosala ete ba onglets esila, bakisá .fade
moko na moko .tab-pane
. Panneau ya onglet ya liboso esengeli mpe kozala .show
na kosala ete makambo ya ebandeli emonanaka.
Ba méthodes asynchrones na ba transitions
Ba méthodes nionso ya API ezali asynchrone mpe ebandi transition . Bazongaka epai ya moto oyo abengi ntango kaka mbongwana ebandi kasi liboso ete esila . En plus, appel ya méthode na composante ya transition ekozala ignorée .
Tala mikanda na biso ya JavaScript mpo na koyeba makambo mosusu.
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.
Pona tab oyo epesami mpe elakisaka panneau na yango oyo esangisi yango. Onglet mosusu nyonso oyo eponami liboso ekómaka oyo eponami te mpe etanda na yango oyo esangisi yango ebombami. Ezongi na mobengi yambo ete esika ya tab elakisama mpenza (elingi koloba liboso ete shown.bs.tab
likambo esalema).
Ebebisaka tab ya élément moko.
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 yahide.bs.tab
événement)shown.bs.tab
(na tab oyo euti kolakisa sika oyo ezali kosala sika, ndenge moko na oyo yashow.bs.tab
likambo yango)
Soki onglet moko te ezalaki déjà activé, alors ba hide.bs.tab
événements na 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. |