in English

Vaendli va swirhendzevutana

Kombisa xiyimo xa ku layicha xa xiphemu kumbe tluka hi swiphepherhele swa Bootstrap, leswi akiweke hi ku helela hi HTML, CSS, naswona ku nga ri na JavaScript.

Hi

Bootstrap “spinners” yinga tirhisiwa ku kombisa xiyimo xa ku layicha eka tiphurojeke ta wena. Ti akiwile ntsena hi HTML na CSS, leswi vulaka leswaku a wu lavi JavaScript leswaku u ti endla. Hambiswiritano, u ta lava JavaScript yin’wana ya ntolovelo leswaku u cinca-cinca ku vonaka ka tona. Ku languteka ka tona, ku ringanana ni ku pima ka tona swi nga endliwa hi ku olova hi titlilasi ta hina to hlamarisa ta switirhisiwa.

Hi swikongomelo swo fikelela, loader yin’wana na yin’wana laha yi katsa role="status"na nested <span class="sr-only">Loading...</span>.

Vuyelo bya animation bya xiphemu lexi byi titshege hi prefers-reduced-motionxivutiso xa midiya. Vona xiyenge xa ​​ku famba loku hungutiweke xa matsalwa ya hina ya ku fikelela .

Xiphepherhele xa ndzilakano

Tirhisa ti border spinners eka xikombiso xa ku layicha xo olova.

Ku layicha...
<div class="spinner-border" role="status">
  <span class="sr-only">Loading...</span>
</div>

Mihlovo

Xiphepherhele xa ndzilakano xi tirhisa currentColoreka xona border-color, leswi vulaka leswaku u nga ha cinca muvala hi switirhisiwa swa muvala wa tsalwa . U nga tirhisa xin’wana ni xin’wana xa switirhisiwa swa hina swa mihlovo ya matsalwa eka xiphepherhele xa ntolovelo.

Ku layicha...
Ku layicha...
Ku layicha...
Ku layicha...
Ku layicha...
Ku layicha...
Ku layicha...
Ku layicha...
<div class="spinner-border text-primary" role="status">
  <span class="sr-only">Loading...</span>
</div>
<div class="spinner-border text-secondary" role="status">
  <span class="sr-only">Loading...</span>
</div>
<div class="spinner-border text-success" role="status">
  <span class="sr-only">Loading...</span>
</div>
<div class="spinner-border text-danger" role="status">
  <span class="sr-only">Loading...</span>
</div>
<div class="spinner-border text-warning" role="status">
  <span class="sr-only">Loading...</span>
</div>
<div class="spinner-border text-info" role="status">
  <span class="sr-only">Loading...</span>
</div>
<div class="spinner-border text-light" role="status">
  <span class="sr-only">Loading...</span>
</div>
<div class="spinner-border text-dark" role="status">
  <span class="sr-only">Loading...</span>
</div>
Ha yini u nga tirhisi swilo leswi tirhisiwaka border-color? Xiphepherhele xin’wana ni xin’wana xa ndzilakano xi boxa transparentndzilakano wa tlhelo rin’we, hikwalaho .border-{color}switirhisiwa swi ta tlula sweswo.

Xiphepherhele lexi kulaka

Loko unga fanelangi border spinner, cincela eka grow spinner. Hambileswi yi nga rhendzelekiki hi tlhelo ra vutshila, yi kula hi ku phindha-phindha!

Ku layicha...
<div class="spinner-grow" role="status">
  <span class="sr-only">Loading...</span>
</div>

Nakambe, xiphepherhele lexi xi akiwile hi currentColor, leswaku u kota ku cinca xivumbeko xa xona hi ku olova hi switirhisiwa swa mihlovo ya matsalwa . Laha yi na muhlovo wa wasi, xikan’we na tinxaka leti seketeriwaka.

Ku layicha...
Ku layicha...
Ku layicha...
Ku layicha...
Ku layicha...
Ku layicha...
Ku layicha...
Ku layicha...
<div class="spinner-grow text-primary" role="status">
  <span class="sr-only">Loading...</span>
</div>
<div class="spinner-grow text-secondary" role="status">
  <span class="sr-only">Loading...</span>
</div>
<div class="spinner-grow text-success" role="status">
  <span class="sr-only">Loading...</span>
</div>
<div class="spinner-grow text-danger" role="status">
  <span class="sr-only">Loading...</span>
</div>
<div class="spinner-grow text-warning" role="status">
  <span class="sr-only">Loading...</span>
</div>
<div class="spinner-grow text-info" role="status">
  <span class="sr-only">Loading...</span>
</div>
<div class="spinner-grow text-light" role="status">
  <span class="sr-only">Loading...</span>
</div>
<div class="spinner-grow text-dark" role="status">
  <span class="sr-only">Loading...</span>
</div>

Ku ringanisa

Ti-spinner eka Bootstrap ti akiwile hi rems, currentColor, na display: inline-flex. Leswi swi vula leswaku ti nga cinca mpimo hi ku olova, ti tlhela ti va ni mihlovo naswona ti hatla ti ringanisiwa.

Makumu

Tirhisa switirhisiwa swa margin ku fana na .m-5ku olova ka ku hambana.

Ku layicha...
<div class="spinner-border m-5" role="status">
  <span class="sr-only">Loading...</span>
</div>

Ku vekiwa ka swilo

Tirhisa switirhisiwa swa flexbox , switirhisiwa swa float , kumbe switirhisiwa swo ringanisa matsalwa ku veka swiphepherhele kahle laha u swi lavaka kona eka xiyimo xihi na xihi.

Olova

Ku layicha...
<div class="d-flex justify-content-center">
  <div class="spinner-border" role="status">
    <span class="sr-only">Loading...</span>
  </div>
</div>
Ku layicha...
<div class="d-flex align-items-center">
  <strong>Loading...</strong>
  <div class="spinner-border ml-auto" role="status" aria-hidden="true"></div>
</div>

Swiphaphama

Ku layicha...
<div class="clearfix">
  <div class="spinner-border float-right" role="status">
    <span class="sr-only">Loading...</span>
  </div>
</div>

Ku ringanisa tsalwa

Ku layicha...
<div class="text-center">
  <div class="spinner-border" role="status">
    <span class="sr-only">Loading...</span>
  </div>
</div>

Sayizi

Engeta .spinner-border-smnaku .spinner-grow-smendla spinner leyintsongo leyinga tirhisiwaka hiku hatlisa endzeni ka swiphemu swin’wana.

Ku layicha...
Ku layicha...
<div class="spinner-border spinner-border-sm" role="status">
  <span class="sr-only">Loading...</span>
</div>
<div class="spinner-grow spinner-grow-sm" role="status">
  <span class="sr-only">Loading...</span>
</div>

Kumbe, tirhisa switayele swa CSS swa ntolovelo kumbe swa le ndzeni ka layini ku cinca tidimenxini tanihilaha swi lavekaka hakona.

Ku layicha...
Ku layicha...
<div class="spinner-border" style="width: 3rem; height: 3rem;" role="status">
  <span class="sr-only">Loading...</span>
</div>
<div class="spinner-grow" style="width: 3rem; height: 3rem;" role="status">
  <span class="sr-only">Loading...</span>
</div>

Swikomba-nkarhi

Tirhisa swiphepherhele endzeni ka swikomba-nkarhi ku kombisa leswaku xiendlo lexi nga eku endliweni kumbe lexi endlekaka sweswi. U nga ha tlhela u cincana tsalwa ri huma eka elemente ya spinner ivi u tirhisa tsalwa ra buti loko swi laveka.

<button class="btn btn-primary" type="button" disabled>
  <span class="spinner-border spinner-border-sm" role="status" aria-hidden="true"></span>
  <span class="sr-only">Loading...</span>
</button>
<button class="btn btn-primary" type="button" disabled>
  <span class="spinner-border spinner-border-sm" role="status" aria-hidden="true"></span>
  Loading...
</button>
<button class="btn btn-primary" type="button" disabled>
  <span class="spinner-grow spinner-grow-sm" role="status" aria-hidden="true"></span>
  <span class="sr-only">Loading...</span>
</button>
<button class="btn btn-primary" type="button" disabled>
  <span class="spinner-grow spinner-grow-sm" role="status" aria-hidden="true"></span>
  Loading...
</button>