Iqembu lohlu
Amaqembu ohlu ayingxenye eguqukayo nenamandla yokubonisa uchungechunge lokuqukethwe. Ziguqule futhi uzinwebe ukuze zisekele cishe noma yikuphi okuqukethwe ngaphakathi.
Iqembu lohlu oluyisisekelo wuhlu olunga-odwe olunezinto zohlu kanye namakilasi afanele. Yakhela phezu kwayo ngezinketho ezilandelayo, noma nge-CSS yakho njengoba kudingeka.
- Cras justo odio
- I-Dapibus ac facilisis in
- I-Morbi leo rius
- I-Porta ac consectetur ac
- I-Vestibulum ne-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>
Engeza .active
ku-a .list-group-item
ukukhombisa ukukhetha okusebenzayo kwamanje.
- Cras justo odio
- I-Dapibus ac facilisis in
- I-Morbi leo rius
- I-Porta ac consectetur ac
- I-Vestibulum ne-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>
Engeza .disabled
ku-a .list-group-item
ukuze ukwenze kubonakale kuvaliwe. Qaphela ukuthi ezinye izinto ezinazo .disabled
zizodinga i-JavaScript yangokwezifiso ukukhubaza ngokugcwele imicimbi yazo yokuchofoza (isb, izixhumanisi).
- Cras justo odio
- I-Dapibus ac facilisis in
- I-Morbi leo rius
- I-Porta ac consectetur ac
- I-Vestibulum ne-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 u <a>
-s noma <button>
u-s ukuze udale izinto zeqembu ezisebenzisekayo ezinezimo ezihambisa phezulu, ezikhutshaziwe, nezisebenzayo ngokwengeza okuthi .list-group-item-action
. Sihlukanisa lezi zigaba-mbumbulu ukuze siqinisekise ukuthi amaqembu ohlu enziwe ngezinto ezingasebenzisani (njengama- <li>
s noma <div>
s) awanikezi ngokuchofoza noma ukuthepha ukukhokhela.
Qiniseka ukuthi awusebenzisi .btn
amakilasi ajwayelekile lapha .
<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, ungakwazi futhi ukusebenzisa disabled
isibaluli esikhundleni .disabled
sekilasi. Ngokudabukisayo, i- <a>
s ayisekeli isici sokukhubazeka.
<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>
Engeza .list-group-flush
ukuze ususe eminye imingcele namakhona ayindilinga ukuze unikeze uhlu lwezinto zeqembu emaphethelweni esiqukathi esingumzali (isb, amakhadi).
- Cras justo odio
- I-Dapibus ac facilisis in
- I-Morbi leo rius
- I-Porta ac consectetur ac
- I-Vestibulum ne-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 amakilasi anomongo ukwenza izinto zohlu lwesitayela ezinengemuva elihle nombala.
- I-Dapibus ac facilisis in
- Lena into yohlu oluyinhloko
- Lena into yeqembu lesibili
- Lena into yeqembu lohlu lwempumelelo
- Lena into yeqembu lohlu lwengozi
- Lena into yeqembu lesexwayiso
- Lena into yeqembu lolwazi
- Lena into yeqembu yohlu olulula
- Lena into yeqembu lohlu olumnyama
<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>
Amakilasi omongo nawo asebenza .list-group-item-action
. Qaphela ukungezwa kwezitayela zokuhambisa phezulu lapha akukho esibonelweni sangaphambilini. Okunye okusekelwa .active
umbuso; isebenzise ukuze ubonise okukhethiwe okusebenzayo entweni yeqembu lokuqukethwe.
<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>
Ukudlulisa incazelo kubuchwepheshe obusizayo
Ukusebenzisa umbala ukwengeza incazelo kunikeza kuphela inkomba ebonakalayo, engeke idluliselwe kubasebenzisi bobuchwepheshe obusizayo - njengezifundi zesikrini. Qinisekisa ukuthi ulwazi olushiwo umbala lusobala kokuqukethwe ngokwako (isb umbhalo obonakalayo), noma lufakwe ngezinye izindlela, njengombhalo owengeziwe ofihliwe .sr-only
nekilasi.
Engeza amabheji kunoma iyiphi into yeqembu lohlu ukuze ubonise izibalo ezingafundiwe, umsebenzi, nokunye ngosizo lwezinye izinsiza .
- Cras justo odio14
- I-Dapibus ac facilisis in2
- I-Morbi leo rius1
<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>
Engeza cishe noma iyiphi i-HTML ngaphakathi, ngisho nasemaqenjini ohlu axhumene njengaleli elingezansi, ngosizo lwezinsiza ze- flexbox .
Faka kuhlu isihloko sento yeqembu
3 izinsuku ezedluleDonec id elit non mi porta gravida at eget metus. I-Maecenas sed diam eget risus varius blandit.
Donec id elit non mi porta.Faka kuhlu isihloko sento yeqembu
3 izinsuku ezedluleDonec id elit non mi porta gravida at eget metus. I-Maecenas sed diam eget risus varius blandit.
Donec id elit non mi porta.Faka kuhlu isihloko sento yeqembu
3 izinsuku ezedluleDonec id elit non mi porta gravida at eget metus. I-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 yethebhu ye-JavaScript—ifake ngayodwa noma bootstrap.js
ngefayela elihlanganisiwe—ukuze unwebe iqembu lethu lohlu ukuze udale amafasitelana angamathebhu okuqukethwe kwasendaweni.
Ungakwazi ukwenza kusebenze ukuzulazula kweqembu lohlu ngaphandle kokubhala noma iyiphi i-JavaScript ngokucacisa data-toggle="list"
noma ngento ethile. Sebenzisa lezi zibaluli zedatha ku- .list-group-item
.
Nika amandla into yohlu lwethebhu nge-JavaScript (into ngayinye yohlu idinga ukwenziwa isebenze ngayodwana):
Ungakwazi ukwenza kusebenze into ngayinye yohlu ngezindlela ezimbalwa:
Ukuze wenze iphaneli yamathebhu ifiphale, .fade
engeza .tab-pane
. Ifasitelana lethebhu yokuqala kufanele futhi .show
lenze okuqukethwe kokuqala kubonakale.
Yenza kusebenze into yohlu nesiqukathi sokuqukethwe. Ithebhu kufanele ibe no-a data-target
noma i href
-container node ku-DOM.
Ikhetha into yohlu enikeziwe futhi ibonise ifasitelana layo elihlotshaniswa nayo. Noma iyiphi enye into yohlu ekhethwe ngaphambilini iyayekwa ukukhethwa futhi ifasitelana layo elihlobene liyafihlwa. Ibuyela kofonayo ngaphambi kokuba kuboniswe ifasitelana lethebhu (isibonelo, ngaphambi kokuba shown.bs.tab
kwenzeke umcimbi).
Uma ubonisa ithebhu entsha, izehlakalo zivutha ngokulandelana okulandelayo:
hide.bs.tab
(kuthebhu esebenzayo yamanje)show.bs.tab
(kuthebhu ezoboniswa)hidden.bs.tab
(kuthebhu esebenzayo yangaphambilini, efanayohide.bs.tab
neyomcimbi)shown.bs.tab
(kuthebhu esanda kuboniswa, efanayoshow.bs.tab
neyomcimbi)
Uma ingekho ithebhu ebisivele isebenza, i- hide.bs.tab
kanye hidden.bs.tab
nemicimbi ngeke ixoshwe.
Uhlobo lomcimbi | Incazelo |
---|---|
show.bs.tab | Lo mcimbi uvutha embukisweni wethebhu, kodwa ngaphambi kokuthi kuboniswe ithebhu entsha. Sebenzisa event.target futhi event.relatedTarget uqondise ithebhu esebenzayo kanye nethebhu esebenzayo yangaphambilini (uma ikhona) ngokulandelanayo. |
ithebhu.bs.ebonisiwe | Lo mcimbi uvutha embukisweni wethebhu ngemva kokuthi ithebhu isibonisiwe. Sebenzisa event.target futhi event.relatedTarget uqondise ithebhu esebenzayo kanye nethebhu esebenzayo yangaphambilini (uma ikhona) ngokulandelanayo. |
fihla.bs.tab | Lo mcimbi uvutha lapho ithebhu entsha izoboniswa (futhi ngaleyo ndlela ithebhu yangaphambilini esebenzayo izofihlwa). Sebenzisa event.target futhi event.relatedTarget uqondise ithebhu esebenzayo yamanje kanye nethebhu entsha ezosebenza maduze, ngokulandelana. |
ithebhu.bs.efihliwe | Lo mcimbi uvutha ngemva kokuboniswa kwethebhu entsha (futhi ngaleyo ndlela ithebhu yangaphambilini esebenzayo ifihliwe). Sebenzisa event.target futhi event.relatedTarget uqondise ithebhu esebenzayo yangaphambilini kanye nethebhu entsha esebenzayo, ngokulandelanayo. |