SourceAlerts
Ipa mamiriro emhinduro mameseji ezviitwa zvemushandisi ane mashoma anowanikwa uye anochinjika echenjedzo meseji.
Mienzaniso
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 .
Yambiro yakareruka yekutanga-ione!
Yambiro yakareruka yechipiri-itarise!
Yambiro iri nyore yekubudirira-itarise!
Nyevero yakapfava yengozi-zvitarise!
Yambiro yakareruka — tarisa!
Yambiro yeruzivo yakapusa-itarise!
Yambiro yakareruka-itarise!
Yambiro yakasviba yakareruka-zvitarise!
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.
Link color
Shandisa .alert-link
utility kirasi kukurumidza kupa anoenderana mavara ekubatanidza mukati meyambiro ipi neipi.
Yambiro yebudiriro yakapusa ine
muenzaniso link . Ipa iyo tinya kana uchida.
Yambiro yakasviba yakareruka ine
muenzaniso link . Ipa iyo tinya kana uchida.
Zvimwe zvemukati
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.
Kudzinga
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:
Holy guacamole! Iwe unofanirwa kutarisa mune mamwe eayo minda pazasi.
JavaScript maitiro
Zvikonzero
Ita kuti chenjedzo iraswe kuburikidza neJavaScript:
Kana data
nehunhu pabhatani mukati meyambiro , sezvaratidzwa pamusoro:
Ziva kuti kuvhara yambiro kuchaibvisa kubva kuDOM.
Nzira
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. |
Zviitiko
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). |