Badhamada
U adeegso qaababka badhanka gaarka ah ee Bootstrap ee ficilada foomamka, wada-hadallada, iyo in ka badan oo leh taageerada cabbirro badan, gobollo, iyo in ka badan.
Tusaalooyinka
Bootstrap waxa ku jira dhawr nooc oo badhan hore loo sii qeexay, mid walbana u adeegaya ujeedadiisa semantic, oo leh dhawr waxyaalood oo dheeri ah oo lagu tuuray si loo xakameeyo.
U gudbinta macnaha tignoolajiyada caawinta
Isticmaalka midabka si loogu daro macnaha kaliya waxay bixisaa tilmaam muuqaal ah, taas oo aan loo gudbin doonin isticmaalayaasha tignoolajiyada caawinta - sida akhristayaasha shaashadda. Hubi in macluumaadka lagu tilmaamay midabku ay ka cad yihiin waxa ku jira laftiisa (tusaale qoraalka muuqda), ama lagu soo daro habab kale, sida qoraal dheeraad ah oo .sr-only
fasalka dhexdiisa ku qarsoon.
Dami duubista qoraalka
Haddii aadan rabin in qoraalka badhanku duubo, waxaad ku dari kartaa .text-nowrap
fasalka badhanka. Gudaha Sass, waxaad dejin kartaa $btn-white-space: nowrap
inaad joojiso duubista qoraalka badhan kasta.
badhanka tags
Fasallada .btn
waxaa loogu talagalay in lagu isticmaalo <button>
curiyaha. Si kastaba ha ahaatee, waxaad sidoo kale isticmaali kartaa fasaladan <a>
ama <input>
walxaha (inkasta oo daalacayaasha qaarkood laga yaabo inay adeegsadaan waxyar ka duwan).
Markaad isticmaalayso casharrada badhanka ee <a>
walxaha loo isticmaalo kicinta shaqaynta bogga (sida macluumaadka burburaya), halkii lagu xidhi lahaa bogag ama qaybo cusub oo ku dhex jira bogga hadda jira, xidhiidhadan waa in la siiyaa role="button"
si ay si habboon ugu gudbiyaan ujeedadooda teknoolajiyada caawinta sida akhristayaasha shaashadda.
Badhamada dulucda
Ma u baahan tahay badhan, laakiin maaha midabada asalka ah ee culus ee ay keenaan? Ku beddel fasallada wax ka beddelka caadiga ah .btn-outline-*
kuwa si aad uga saarto dhammaan sawirada asalka iyo midabada badhanka kasta.
Cabbirrada
Ma jeceshahay badhamada waaweyn ama ka yar? Ku dar .btn-lg
ama .btn-sm
cabbiro dheeraad ah.
Abuur badhamada heerka xannibaadda—kuwa ballaca buuxa ee waalidka—adigoo ku daraya .btn-block
.
Xaalad firfircoon
Badhamada waxay u muuqan doonaan la riixo (oo leh asal madow, xuduud madow, iyo hooska gudaha) marka ay firfircoon yihiin. Looma baahna in lagu daro fasal <button>
s marka ay isticmaalaan fasalka been abuurka ah . Si kastaba ha ahaatee, waxaad weli ku qasbi kartaa isla muuqaalka firfircoon .active
(oo ku dar aria-pressed="true"
sifada) haddii aad u baahan tahay inaad si barnaamij ah gobolka ugu soo celiso.
Gobolka naafada
Ka dhig badhamada kuwo aan shaqayn adiga oo ku daraya disabled
sifada booleenka shay kasta <button>
.
Badhamada naafada ah ee isticmaalaya <a>
curiyaha ayaa u dhaqma xoogaa ka duwan:
<a>
s ma taageeraandisabled
sifada, markaa waa inaad ku dartaa.disabled
fasalka si aad muuqaal ahaan ugu ekaato mid naafo ah.- Qaar ka mid ah qaababka mustaqbalka-saaxiibtinimo ayaa lagu soo daray si loo joojiyo dhammaan
pointer-events
badhamada barroosinka. browser-yada taageera hantidaas, kuma arki doontid cursorka naafada ah gabi ahaanba. - Badhamada naafada ah waa inay ku jiraan
aria-disabled="true"
sifada si ay u muujiso xaalada curiyaha tignoolajiyada caawinta.
Tilmaamaha shaqeynta isku xirka
Fasalka .disabled
wuxuu isticmaalaa pointer-events: none
inuu isku dayo inuu joojiyo shaqada isku xirka <a>
s, laakiin hantida CSS weli lama jaan qaadin. Intaa waxaa dheer, xitaa daalacashada caawiya pointer-events: none
, navigation kiiboodhka ayaa weli ah mid aan saameyn ku yeelan, taasoo la macno ah in isticmaalayaasha kiiboodhka ee arka iyo isticmaalayaasha tignoolajiyada caawinta ay wali awood u yeelan doonaan in ay dhaqaajiyaan xiriiriyeyaashan. Markaa si aad u badbaado, ku dar tabindex="-1"
sifo xidhiidhyadan (si aad uga ilaaliso inay helaan diiradda kiiboodhka) oo isticmaal JavaScript-ka caadiga ah si aad u curyaamiso hawlahooda.
Button plugin
Wax badan ku samee badhamada. Xakamaynta badhanka ayaa sheegaysa ama samee kooxo badhamada qaybo badan sida qalabyada.
Beddel gobolada
Ku dar si aad u beddesho xaaladda data-toggle="button"
badhanka active
Haddi aad hore u rogrogayso badhanka, waa in aad gacanta ku darto .active
fasalka iyo .aria-pressed="true"
<button>
Sanduuqa hubinta iyo badhamada raadiyaha
Qaababka Bootstrap .button
waxaa lagu dabaqi karaa walxaha kale, sida <label>
s, si loo bixiyo sanduuqa hubinta ama qaabka raadiyaha ee badhanka beddelka. Ku dar badhamadaas wax laga beddelay si aad awood ugu yeelatid dhaqankooda qallafsan ee JavaScript oo ku dar data-toggle="buttons"
qaabka s ku dhex jira badhamadaada. Ogsoonow inaad abuuri karto badhammo ku shaqeeya hal-ku-gal ama kooxo iyaga ka mid ah..btn-group
.btn-group-toggle
<input>
Xaaladda la hubiyay ee badhamadan waxa kaliya oo lagu cusboonaysiiyaa click
dhacdada badhanka. Haddii aad isticmaasho hab kale si aad u cusboonaysiiso gelinta—tusaale, la <input type="reset">
ama adiga oo gacanta ku dabaqaya hantida gelinta checked
—waxa aad u baahan doontaa in aad gacanta .active
ku <label>
shido.
Ogsoonow in badhamada horay loo hubiyay ay u baahan yihiin inaad gacanta ku darto .active
fasalka gelinta <label>
.
Hababka
Habka | Sharaxaada |
---|---|
$().button('toggle') |
Beddelayaa gobolka riix Siinaya badhanka muuqaalka in la hawlgeliyay. |
$().button('dispose') |
Wuxuu baabi'iyaa badhanka curiyaha. |