SourceUkwenziwa kwePagination
Amaxwebhu kunye nemizekelo yokubonisa ukwenziwa kwamaphepha ukubonisa uluhlu lwesiqulatho esiyeleleneyo sikhona kumaphepha amaninzi.
Isishwankathelo
Sisebenzisa ibhloko enkulu yamakhonkco aqhagamshelweyo kwi-pagination yethu, ukwenza amakhonkco abe nzima ukuwaphosa kwaye ahlaziywe ngokulula-ngalo lonke ixesha ebonelela ngeendawo ezinkulu ezibethayo. IPagination yakhiwe ngoluhlu lwezinto zeHTML ukuze abafundi besikrini babhengeze inani lamakhonkco akhoyo. Sebenzisa into yokusonga <nav>
ukuyichonga njengecandelo lokukhangela kwiscreen readers kunye nobunye ubugcisa bokuncedisa.
Ukongeza, njengoko amaphepha enokuba nangaphezulu kwelinye icandelo lokukhangela elinjalo, kuyacetyiswa ukuba unikeze inkcazo aria-label
ukuze <nav>
ibonise injongo yayo. Umzekelo, ukuba indawo yokubhala isetyenziselwa ukuzulazula phakathi kweqela leziphumo zokhangelo, ileyibhile efanelekileyo inokuba aria-label="Search results pages"
.
Ukusebenza ngee-icon
Ngaba ujonge ukusebenzisa i-icon okanye isimboli endaweni yesicatshulwa kwezinye ikhonkco leepagination? Qinisekisa ukubonelela ngenkxaso yesifundi sesikrini esifanelekileyo ngeempawu aria
.
Iimeko ezikhubazekileyo nezisebenzayo
Iikhonkco zePagination ziyakwazi ukwenzeka kwiimeko ezahlukeneyo. Sebenzisa .disabled
amakhonkco abonakala engenakucofa kunye .active
nokubonisa iphepha langoku.
Ngelixa .disabled
iklasi isebenzisa pointer-events: none
ukuzama ukukhubaza usebenziso lwekhonkco lwe- s<a>
, loo propati ye-CSS ayikabikho emgangathweni kwaye ayiphenduli kukhangelo lwebhodi yezitshixo. Ngokunjalo, kufuneka usoloko usongeza tabindex="-1"
kuqhagamshelo oluvaliweyo kwaye usebenzise iJavaScript yesiko ukuvala ukusebenza kwayo ngokupheleleyo.
Ungatshintsha ngokukhetha iiankile ezisebenzayo okanye ezikhubazekileyo ze <span>
, okanye ushiye iiankile kwimeko yangaphambili/elandelayo iintolo, ukususa umsebenzi wonqakrazo kwaye uthintele ugxininiso lwebhodi yezitshixo ngelixa ugcina izimbo ezicetyiweyo.
Ubungakanani
Ngaba ufuna ukwenza i-pagination enkulu okanye encinci? Yongeza .pagination-lg
okanye .pagination-sm
iisayizi ezongezelelweyo.
Ulungelelwaniso
Guqula ulungelelwaniso lwamacandelo ephegination ngezixhobo ze- flexbox .