Alerts
Ipa mamiriro emhinduro mameseji ezviitwa zvemushandisi ane mashoma anowanikwa uye anochinjika echenjedzo meseji.
Zviziviso zviripo kune chero hurefu hwemavara, pamwe nebhatani rekusarudzika. Kuti uite manyorerwo akakodzera, shandisa imwe yemakirasi masere anodiwa.alert-success
emamiriro ezvinhu (semuenzaniso, ). Pakudzingwa mukati, shandisa chenjedzo jQuery plugin .
<div class="alert alert-primary" role="alert">
This is a primary alert—check it out!
</div>
<div class="alert alert-secondary" role="alert">
This is a secondary alert—check it out!
</div>
<div class="alert alert-success" role="alert">
This is a success alert—check it out!
</div>
<div class="alert alert-danger" role="alert">
This is a danger alert—check it out!
</div>
<div class="alert alert-warning" role="alert">
This is a warning alert—check it out!
</div>
<div class="alert alert-info" role="alert">
This is a info alert—check it out!
</div>
<div class="alert alert-light" role="alert">
This is a light alert—check it out!
</div>
<div class="alert alert-dark" role="alert">
This is a dark alert—check it out!
</div>
Kuendesa zvinoreva kunobatsira matekinoroji
Kushandisa ruvara kuwedzera zvinoreva kunongopa chiratidzo chekuona, icho chisingazopirwe kune vashandisi vetekinoroji yekubatsira - senge zvidzitiro zvekuverenga. Ita shuwa kuti ruzivo rwunoratidzwa neruvara rwuri pachena kubva pane zvirimo (semuzvinyorwa zvinooneka), kana kuti zvinosanganisirwa neimwe nzira, senge mamwe mavara akavigwa .sr-only
nekirasi.
Shandisa .alert-link
utility kirasi kukurumidza kupa anoenderana mavara ekubatanidza mukati meyambiro ipi neipi.
<div class="alert alert-primary" role="alert">
This is a primary alert with <a href="#" class="alert-link">an example link</a>. Give it a click if you like.
</div>
<div class="alert alert-secondary" role="alert">
This is a secondary alert with <a href="#" class="alert-link">an example link</a>. Give it a click if you like.
</div>
<div class="alert alert-success" role="alert">
This is a success alert with <a href="#" class="alert-link">an example link</a>. Give it a click if you like.
</div>
<div class="alert alert-danger" role="alert">
This is a danger alert with <a href="#" class="alert-link">an example link</a>. Give it a click if you like.
</div>
<div class="alert alert-warning" role="alert">
This is a warning alert with <a href="#" class="alert-link">an example link</a>. Give it a click if you like.
</div>
<div class="alert alert-info" role="alert">
This is a info alert with <a href="#" class="alert-link">an example link</a>. Give it a click if you like.
</div>
<div class="alert alert-light" role="alert">
This is a light alert with <a href="#" class="alert-link">an example link</a>. Give it a click if you like.
</div>
<div class="alert alert-dark" role="alert">
This is a dark alert with <a href="#" class="alert-link">an example link</a>. Give it a click if you like.
</div>
Yambiro inogona zvakare kuve nekuwedzera HTML zvinhu senge misoro, ndima uye divider.
Kuita zvakanaka!
Aww hongu, iwe wakabudirira kuverenga iyi yakakosha meseji yekuzivisa. Uyu muenzaniso mameseji uchamhanya zvishoma kuitira kuti iwe uone kuti nzvimbo mukati meyambiro inoshanda sei nerudzi urwu rwemukati.
Pese paunoda, iva nechokwadi chekushandisa margin utilities kuchengetedza zvinhu zvakanaka uye zvakatsvinda.
<div class="alert alert-success" role="alert">
<h4 class="alert-heading">Well done!</h4>
<p>Aww yeah, you successfully read this important alert message. This example text is going to run a bit longer so that you can see how spacing within an alert works with this kind of content.</p>
<hr>
<p class="mb-0">Whenever you need to, be sure to use margin utilities to keep things nice and tidy.</p>
</div>
Uchishandisa yambiro yeJavaScript plugin, zvinokwanisika kudzinga chero yambiro inline. Heino maitiro:
- Ita shuwa kuti waisa yambiro plugin, kana yakaunganidzwa Bootstrap JavaScript.
- Kana iwe uri kuvaka yedu JavaScript kubva kunobva, zvinoda
util.js
. Iyo yakaunganidzwa vhezheni inosanganisira iyi. - Wedzera bhatani rekudzinga uye
.alert-dismissible
kirasi, iyo inowedzera imwe padding kurudyi rweyambiro uye inoisa.close
bhatani. - Pabhatani rekudzinga, wedzera
data-dismiss="alert"
hunhu, izvo zvinokonzeresa kushanda kweJavaScript. Iva nechokwadi chekushandisa<button>
chinhu nacho kuita zvakanaka pamidziyo yese. - Kuti upe chenjedzo paunenge uchivadzinga, ita chokwadi chekuwedzera
.fade
uye.show
makirasi.
Iwe unogona kuona izvi muchiito neiyo live demo:
<div class="alert alert-warning alert-dismissible fade show" role="alert">
<strong>Holy guacamole!</strong> You should check in on some of those fields below.
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
Ita kuti chenjedzo iraswe kuburikidza neJavaScript:
Kana data
nehunhu pabhatani mukati meyambiro , sezvaratidzwa pamusoro:
Ziva kuti kuvhara yambiro kuchaibvisa kubva kuDOM.
Nzira | Tsanangudzo |
---|---|
$().alert() |
Inoita yambiro yekuteerera kune zviitiko zvekudzvanya pane zvedzinza zvine data-dismiss="alert" hunhu. (Hazvina basa kana uchishandisa iyo data-api's auto-initialization.) |
$().alert('close') |
Inovhara yambiro nekuibvisa muDOM. Kana iyo .fade uye .show makirasi aripo pane chinhu, yambiro inopera isati yabviswa. |
$().alert('dispose') |
Inoparadza chenjedzo yechinhu. |
Bootstrap's alert plugin inofumura zviitiko zvishoma zvekukochekera mune yambiro mashandiro.
Chiitiko | Tsanangudzo |
---|---|
close.bs.alert |
Ichi chiitiko chinopisa nekukasira kana close nzira yemuenzaniso inodanwa. |
closed.bs.alert |
Ichi chiitiko chinodzingwa kana yambiro yavharwa (ichamirira CSS shanduko kuti ipere). |