in English

Ndị na-agbagharị agbagharị

Gosipụta ọnọdụ nbudata nke akụrụngwa ma ọ bụ ibe nwere ndị na-agbagharị Bootstrap, ejiri HTML, CSS, na enweghị Javascript rụọ kpamkpam.

Ihe gbasara

Enwere ike iji “spinners” bootstrap gosi ọkwa nbudata na ọrụ gị. Ejiri HTML na CSS rụọ ha, nke pụtara na ịchọghị Javascript ọ bụla iji mepụta ha. Otú ọ dị, ị ga-achọ ụfọdụ Javascript omenala iji gbanwee visibiliti ha. Enwere ike ịhazi ọdịdị ha, nhazi na nha ha n'ụzọ dị mfe site na klaasị ịba uru dị ịtụnanya.

Maka ebumnuche nnweta, onye na-ebu ibu ọ bụla ebe a gụnyere role="status"yana akwụkwụ <span class="sr-only">Loading...</span>.

Mmetụta animation nke akụrụngwa a dabere na prefers-reduced-motionajụjụ mgbasa ozi. Hụ akụkụ ngagharị ewelatala nke akwụkwọ nnweta anyị .

Ọkpụkpụ okirikiri

Jiri spinner oke ala maka ihe ngosi nbunye dị fechaa.

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

Agba

The ókè-ala spinner na-eji currentColorya border-color, nke pụtara na ị nwere ike hazie agba na ederede utilities . Ị nwere ike iji ngwa ọ bụla nke agba ederede anyị na spinner ọkọlọtọ.

Na-ebu...
Na-ebu...
Na-ebu...
Na-ebu...
Na-ebu...
Na-ebu...
Na-ebu...
Na-ebu...
<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>
Gịnị kpatara na ị gaghị eji border-colorakụrụngwa? Ọkpụkpụ oke ọ bụla na-akọwapụta transparentoke maka opekata mpe otu akụkụ, yabụ .border-{color}akụrụngwa ga-ewepụ nke ahụ.

Spinner na-eto eto

Ọ bụrụ na ịmasịghị spinner oke, gbanwee gaa na spinner na-eto eto. Ọ bụ ezie na ọ naghị atụgharị na teknụzụ, ọ na-eto ugboro ugboro!

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

Ọzọkwa, a na-eji spinner rụọ ya currentColor, yabụ ị nwere ike ịgbanwe ọdịdị ya ngwa ngwa site na iji ngwa ederede ederede . Ebe a na-acha anụnụ anụnụ, yana ụdị akwadoro.

Na-ebu...
Na-ebu...
Na-ebu...
Na-ebu...
Na-ebu...
Na-ebu...
Na-ebu...
Na-ebu...
<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>

Nhazi

Eji rems, currentColor, na display: inline-flex. Nke a pụtara na enwere ike gbanwee ha n'ụzọ dị mfe, gbanwee agba, na ịhazi ngwa ngwa.

Oke

Jiri akụrụngwa oke dị ka .m-5maka oghere dị mfe.

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

Ndokwa

Jiri flexbox utilities , float utilities , ma ọ bụ ederede alignment utilities idobe spinners kpọmkwem ebe ị chọrọ ha n'ọnọdụ ọ bụla.

Flex

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

Na-ese n'elu

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

Nhazi ederede

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

Nha

Tinye .spinner-border-smna .spinner-grow-smime obere spinner nke enwere ike iji ngwa ngwa n'ime ihe ndị ọzọ.

Na-ebu...
Na-ebu...
<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>

Ma ọ bụ, jiri CSS omenala ma ọ bụ ụdị ahịrị iji gbanwee akụkụ dịka achọrọ.

Na-ebu...
Na-ebu...
<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>

Bọtịnụ

Jiri spinners n'ime bọtịnụ gosi na a na-ahazi ma ọ bụ na-eme ugbu a. Ị nwekwara ike gbanwee ederede na akụkụ spinner wee jiri ederede bọtịnụ dị ka achọrọ.

<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>