Uluhlu lweqela
Amaqela oluhlu ayinxalenye eguquguqukayo kwaye enamandla yokubonisa uluhlu lomxholo. Guqula kwaye uyandise ukuxhasa malunga nawo nawuphi na umxholo ongaphakathi.
Elona qela loluhlu olusisiseko luluhlu olungacwangciswanga olunezinto zoluhlu kunye neeklasi ezifanelekileyo. Yakha phezu kwayo ngeenketho ezilandelayo, okanye ngeyakho iCSS njengoko kufuneka.
- Cras justo odio
- Dapibus ac facilisis in
- UMorbi namhlanje
- Porta ac consectetur ac
- Vestibulum kunye eros
<ul class="list-group">
<li class="list-group-item">Cras justo odio</li>
<li class="list-group-item">Dapibus ac facilisis in</li>
<li class="list-group-item">Morbi leo risus</li>
<li class="list-group-item">Porta ac consectetur ac</li>
<li class="list-group-item">Vestibulum at eros</li>
</ul>
Yongeza .active
kwi- .list-group-item
a ukubonisa ukhetho olusebenzayo lwangoku.
- Cras justo odio
- Dapibus ac facilisis in
- UMorbi namhlanje
- Porta ac consectetur ac
- Vestibulum kunye eros
<ul class="list-group">
<li class="list-group-item active">Cras justo odio</li>
<li class="list-group-item">Dapibus ac facilisis in</li>
<li class="list-group-item">Morbi leo risus</li>
<li class="list-group-item">Porta ac consectetur ac</li>
<li class="list-group-item">Vestibulum at eros</li>
</ul>
Yongeza .disabled
ku-a .list-group-item
ukuze ibonakale ivaliwe. Qaphela ukuba ezinye izinto kunye .disabled
nazo ziyakufuna iJavaScript yesiko ukuvala imisitho yokucofa ngokupheleleyo (umzekelo, amakhonkco).
- Cras justo odio
- Dapibus ac facilisis in
- UMorbi namhlanje
- Porta ac consectetur ac
- Vestibulum kunye eros
<ul class="list-group">
<li class="list-group-item disabled">Cras justo odio</li>
<li class="list-group-item">Dapibus ac facilisis in</li>
<li class="list-group-item">Morbi leo risus</li>
<li class="list-group-item">Porta ac consectetur ac</li>
<li class="list-group-item">Vestibulum at eros</li>
</ul>
Sebenzisa i- <a>
s okanye <button>
i-s ukwenza uluhlu lwezinto ezisebenzayo zeqela nge-hover, ivaliwe, kunye neemeko ezisebenzayo ngokudibanisa .list-group-item-action
. Sahlula ezi klasi pseudo-ukuqinisekisa uluhlu lwamaqela ezenziwe non-interactive element (ezifana <li>
s okanye <div>
s) ababoneleli ngonqakrazo okanye ucofe ukufikelela.
Qinisekisa ukuba ungasebenzisi .btn
iiklasi eziqhelekileyo apha .
<div class="list-group">
<a href="#" class="list-group-item list-group-item-action active">
Cras justo odio
</a>
<a href="#" class="list-group-item list-group-item-action">Dapibus ac facilisis in</a>
<a href="#" class="list-group-item list-group-item-action">Morbi leo risus</a>
<a href="#" class="list-group-item list-group-item-action">Porta ac consectetur ac</a>
<a href="#" class="list-group-item list-group-item-action disabled">Vestibulum at eros</a>
</div>
Nge <button>
s, ungenza kwakhona ukusebenzisa disabled
uphawu endaweni .disabled
yeklasi. Okulusizi kukuba, <a>
abaluxhasi uphawu lokukhubazeka.
<div class="list-group">
<button type="button" class="list-group-item list-group-item-action active">
Cras justo odio
</button>
<button type="button" class="list-group-item list-group-item-action">Dapibus ac facilisis in</button>
<button type="button" class="list-group-item list-group-item-action">Morbi leo risus</button>
<button type="button" class="list-group-item list-group-item-action">Porta ac consectetur ac</button>
<button type="button" class="list-group-item list-group-item-action" disabled>Vestibulum at eros</button>
</div>
Yongeza .list-group-flush
ukususa imida ethile kunye neekona ezingqukuva ukunika uluhlu lwezinto zeqela edge-to-edge kwisikhongozeli esingumzali (umzekelo, amakhadi).
- Cras justo odio
- Dapibus ac facilisis in
- UMorbi namhlanje
- Porta ac consectetur ac
- Vestibulum kunye eros
<ul class="list-group list-group-flush">
<li class="list-group-item">Cras justo odio</li>
<li class="list-group-item">Dapibus ac facilisis in</li>
<li class="list-group-item">Morbi leo risus</li>
<li class="list-group-item">Porta ac consectetur ac</li>
<li class="list-group-item">Vestibulum at eros</li>
</ul>
Sebenzisa iiklasi zomxholo ukwenza uluhlu lwezinto ezinemvelaphi kunye nombala obalaseleyo.
- Dapibus ac facilisis in
- Lo ngumba woluhlu oluphambili
- Le yinxalenye yoluhlu lwesibini loluhlu
- Le yimpumelelo yoluhlu lweqela
- Le yinxalenye yoluhlu lwengozi yeqela
- Lo ngumba woluhlu lwesilumkiso
- Lo luhlu lolwazi umba weqela
- Lo luhlu olukhanyayo umba weqela
- Lo ngumba weqela elimnyama
<ul class="list-group">
<li class="list-group-item">Dapibus ac facilisis in</li>
<li class="list-group-item list-group-item-primary">This is a primary list group item</li>
<li class="list-group-item list-group-item-secondary">This is a secondary list group item</li>
<li class="list-group-item list-group-item-success">This is a success list group item</li>
<li class="list-group-item list-group-item-danger">This is a danger list group item</li>
<li class="list-group-item list-group-item-warning">This is a warning list group item</li>
<li class="list-group-item list-group-item-info">This is a info list group item</li>
<li class="list-group-item list-group-item-light">This is a light list group item</li>
<li class="list-group-item list-group-item-dark">This is a dark list group item</li>
</ul>
Iiklasi zomxholo nazo zisebenza kunye .list-group-item-action
. Qaphela ukongezwa kwezitayile ze-hover apha azikho kumzekelo wangaphambili. Ikwaxhaswa .active
ngurhulumente; yifake ukubonisa ukhetho olusebenzayo kuluhlu lomxholo wento yeqela.
<div class="list-group">
<a href="#" class="list-group-item list-group-item-action">Dapibus ac facilisis in</a>
<a href="#" class="list-group-item list-group-item-action list-group-item-primary">This is a primary list group item</a>
<a href="#" class="list-group-item list-group-item-action list-group-item-secondary">This is a secondary list group item</a>
<a href="#" class="list-group-item list-group-item-action list-group-item-success">This is a success list group item</a>
<a href="#" class="list-group-item list-group-item-action list-group-item-danger">This is a danger list group item</a>
<a href="#" class="list-group-item list-group-item-action list-group-item-warning">This is a warning list group item</a>
<a href="#" class="list-group-item list-group-item-action list-group-item-info">This is a info list group item</a>
<a href="#" class="list-group-item list-group-item-action list-group-item-light">This is a light list group item</a>
<a href="#" class="list-group-item list-group-item-action list-group-item-dark">This is a dark list group item</a>
</div>
Ukuhambisa intsingiselo kwiiteknoloji ezincedisayo
Ukusebenzisa umbala ukongeza intsingiselo kubonelela kuphela ngesalathiso esibonakalayo, esingayi kuthunyelwa kubasebenzisi betekhnoloji encedisayo - njengezifundi zesikrini. Qinisekisa ukuba ulwazi olubonakaliswe ngumbala lucacile kumxholo ngokwawo (umzekelo, umbhalo obonakalayo), okanye luqukwe ngezinye iindlela, ezifana nesicatshulwa esongezelelweyo esifihlwe .sr-only
eklasini.
Yongeza iibheji kuyo nayiphi na into yeqela loluhlu ukubonisa amanani angafundwanga, umsebenzi, kunye nokunye ngoncedo lwezinye izinto eziluncedo .
- Cras justo odio14
- Dapibus ac facilisis in2
- UMorbi namhlanje1
<ul class="list-group">
<li class="list-group-item d-flex justify-content-between align-items-center">
Cras justo odio
<span class="badge badge-primary badge-pill">14</span>
</li>
<li class="list-group-item d-flex justify-content-between align-items-center">
Dapibus ac facilisis in
<span class="badge badge-primary badge-pill">2</span>
</li>
<li class="list-group-item d-flex justify-content-between align-items-center">
Morbi leo risus
<span class="badge badge-primary badge-pill">1</span>
</li>
</ul>
Yongeza phantse nayiphi na i-HTML ngaphakathi, nakuluhlu lwamaqela adityanisiweyo afana neli lingezantsi, ngoncedo lwezinto eziluncedo ze- flexbox .
Uluhlu lwesihloko sento yeqela
kwiintsuku ezi-3 ezidlulileyoDonec id elit non mi porta gravida at eget metus. Maecenas sed diam eget risus varius blandit.
Donec id elit non mi porta.Uluhlu lwesihloko sento yeqela
kwiintsuku ezi-3 ezidlulileyoDonec id elit non mi porta gravida at eget metus. Maecenas sed diam eget risus varius blandit.
Donec id elit non mi porta.Uluhlu lwesihloko sento yeqela
kwiintsuku ezi-3 ezidlulileyoDonec id elit non mi porta gravida at eget metus. Maecenas sed diam eget risus varius blandit.
Donec id elit non mi porta.<div class="list-group">
<a href="#" class="list-group-item list-group-item-action flex-column align-items-start active">
<div class="d-flex w-100 justify-content-between">
<h5 class="mb-1">List group item heading</h5>
<small>3 days ago</small>
</div>
<p class="mb-1">Donec id elit non mi porta gravida at eget metus. Maecenas sed diam eget risus varius blandit.</p>
<small>Donec id elit non mi porta.</small>
</a>
<a href="#" class="list-group-item list-group-item-action flex-column align-items-start">
<div class="d-flex w-100 justify-content-between">
<h5 class="mb-1">List group item heading</h5>
<small class="text-muted">3 days ago</small>
</div>
<p class="mb-1">Donec id elit non mi porta gravida at eget metus. Maecenas sed diam eget risus varius blandit.</p>
<small class="text-muted">Donec id elit non mi porta.</small>
</a>
<a href="#" class="list-group-item list-group-item-action flex-column align-items-start">
<div class="d-flex w-100 justify-content-between">
<h5 class="mb-1">List group item heading</h5>
<small class="text-muted">3 days ago</small>
</div>
<p class="mb-1">Donec id elit non mi porta gravida at eget metus. Maecenas sed diam eget risus varius blandit.</p>
<small class="text-muted">Donec id elit non mi porta.</small>
</a>
</div>
Sebenzisa i-plugin ye-JavaScript yethebhu-yibandakanye ngabanye okanye ngefayile ehlanganisiweyo bootstrap.js
-ukwandisa iqela lethu loluhlu ukwenza iipaneli ze-tableable zomxholo wendawo.
Unokwenza ukhangelo lweqela loluhlu ngaphandle kokubhala nasiphi na iJavaScript ngokuchaza ngokulula data-toggle="list"
okanye kwinto. Sebenzisa ezi mpawu zedatha kwi .list-group-item
.
Yenza umba woluhlu olunokubakho ngeJavaScript (uluhlu ngalunye kufuneka luvulwe ngokwalo):
Unokwenza uluhlu ngalunye lusebenze ngeendlela ezininzi:
Ukwenza indawo yolawulo yeethebhu iphelelwe, yongeza .fade
kuyo nganye .tab-pane
. Ipheyini yethebhu yokuqala kufuneka kwakhona .show
yenze umxholo wokuqala ubonakale.
Yenza kusebenze into yoluhlu kunye nesiqulatho somxholo. Isithuba kufuneka sibenendawo data-target
okanye indawo href
yesikhongozeli kwiDOM.
Ikhetha umba woluhlu olunikiweyo kwaye ibonise isahlulo sayo esinxulumeneyo. Nayiphi na enye into yoluhlu ebikhe yakhethwa ngaphambili ayikhethwanga kwaye isahlulo sayo esinxulumeneyo siyafihlwa. Ibuyisela kumnxebi phambi kokuba ipayini yethebhu iboniswe ngokwenene (umzekelo, phambi kokuba shown.bs.tab
isiganeko senzeke).
Xa ubonisa ithebhu entsha, iziganeko zivutha ngolu hlobo lulandelayo:
hide.bs.tab
(kwithebhu esebenzayo yangoku)show.bs.tab
(kwi-eza kuboniswa thebhu)hidden.bs.tab
(kwithebhu esebenzayo yangaphambili, efanayo nalehide.bs.tab
yesiganeko)shown.bs.tab
(kwisithuba esandula ukusebenza esivele sibonise ithebhu, efanayoshow.bs.tab
nesesiganeko)
Ukuba akukho thebhu ibisele iyasebenza, i hide.bs.tab
kunye hidden.bs.tab
neziganeko aziyi kugxothwa.
Uhlobo lomsitho | Inkcazo |
---|---|
bonisa.bs.tab | Esi siganeko sivutha kumboniso wethebhu, kodwa ngaphambi kokuba ithebhu entsha iboniswe. Sebenzisa event.target kunye event.relatedTarget nokujolisa isithuba esisebenzayo kunye nesithuba sangaphambili esisebenzayo (ukuba sikhona) ngokulandelelanayo. |
ebonisiweyo.bs.tab | Esi siganeko sitshisa kwi-tab show emva kokuba ithebhu ibonisiwe. Sebenzisa event.target kunye event.relatedTarget nokujolisa isithuba esisebenzayo kunye nesithuba sangaphambili esisebenzayo (ukuba sikhona) ngokulandelelanayo. |
fihla.bs.tab | Esi siganeko sitshisa xa isithuba esitsha siza kuboniswa (kwaye ke isithuba sangaphambili esisebenzayo siza kufihlwa). Sebenzisa event.target kunye event.relatedTarget nokujolisa ithebhu esebenzayo yangoku kunye nethebhu entsha eza kusebenza ngokukhawuleza, ngokulandelelanayo. |
efihliweyo.bs.tab | Esi siganeko sivutha emva kokuba ithebhu entsha ibonisiwe (kwaye ke isithuba sangaphambili esisebenzayo sifihliwe). Sebenzisa event.target kunye event.relatedTarget nokujolisa kwithebhu esebenzayo yangaphambili kunye nethebhu entsha esebenzayo, ngokulandelelanayo. |