SourceImenyesha
Tanga ibitekerezo byerekeranye nubutumwa bwibikorwa byabakoresha bisanzwe hamwe nubutumwa buboneka kandi bworoshye bwo kumenyesha.
Imenyesha riraboneka kuburebure bwinyandiko, kimwe nubushake bwo kwirukana. Kuburyo bukwiye, koresha kimwe mubyiciro umunani bisabwa.alert-success
(urugero, ). Kubirukana kumurongo, koresha imenyesha jQuery plugin .
Imenyekanisha ryibanze ryibanze - reba neza!
Icyitonderwa cyoroheje cya kabiri - reba neza!
Intsinzi yoroshye yo kumenyesha - reba neza!
Kumenyesha ibyago byoroshye - reba neza!
Imenyesha ryoroshye ryo kuburira - reba neza!
Amakuru yoroshye yo kumenyesha - reba neza!
Umucyo woroshye - reba neza!
Ikimenyetso cyijimye cyoroshye - reba neza!
Gutanga ibisobanuro kubuhanga bufasha
Gukoresha ibara kugirango wongere ibisobanuro bitanga gusa icyerekezo cyerekana, kitazashyikirizwa abakoresha tekinoroji ifasha - nk'abasoma ecran. Menya neza ko amakuru yerekanwe n'ibara agaragara uhereye kubirimo ubwabyo (urugero: inyandiko igaragara), cyangwa bigashyirwa muburyo butandukanye, nk'inyandiko y'inyongera ihishe hamwe .sr-only
n'ishuri.
Koresha urwego .alert-link
rwingirakamaro kugirango utange byihuse guhuza amabara muburyo ubwo aribwo bwose.
Byoroheje byibanze byibanze hamwe
nurugero rwihuza . Tanga gukanda niba ubishaka.
Byoroheje byongeye kumenyesha hamwe
nurugero rwihuza . Tanga gukanda niba ubishaka.
Intsinzi yoroshye yo kumenyesha hamwe
nurugero rwihuza . Tanga gukanda niba ubishaka.
Akaga koroheje kamenyesha hamwe
nurugero ruhuza . Tanga gukanda niba ubishaka.
Amakuru yoroshye yo kumenyesha hamwe
nurugero rwihuza . Tanga gukanda niba ubishaka.
Urumuri rworoheje rumenyesha hamwe
nurugero ruhuza . Tanga gukanda niba ubishaka.
Imenyesha rishobora kandi kubamo HTML yinyongera nkimitwe, paragarafu nabatandukanya.
Muraho neza!
Aww yego, wasomye neza ubu butumwa bwingenzi bwo kumenyesha. Uru rugero inyandiko igiye gukora birebire kugirango ubashe kubona uburyo intera iri mubimenyesha ikorana nubwoko bwibirimo.
Igihe cyose ubikeneye, menya neza gukoresha margin utanga ibintu kugirango ibintu bishoboke.
Ukoresheje plugin ya JavaScript imenyesha, birashoboka gusezerera umurongo uwo ari wo wose. Dore uko:
- Menya neza ko wapakiye plugin yo kumenyesha, cyangwa icyegeranyo cya Bootstrap JavaScript.
- Niba wubaka JavaScript yacu kuva isoko, birasaba
util.js
. Inyandiko yakozwe ikubiyemo ibi.
- Ongeraho buto yo kwirukana hamwe
.alert-dismissible
nishuri, byongeramo padi iburyo bwiburyo bwo kumenyesha no gushyira .close
buto.
- Kuri buto yo kwirukana, ongeramo
data-dismiss="alert"
ikiranga, gikurura imikorere ya JavaScript. Witondere gukoresha <button>
element hamwe nayo kugirango imyitwarire iboneye mubikoresho byose.
- Kugirango ushushanye kumenyesha mugihe ubirukanye, menya kongeramo
.fade
amasomo .show
.
Urashobora kubibona mubikorwa hamwe na demo nzima:
Guacamole yera! Ugomba kugenzura kuri bimwe muribi bikurikira.
Imyitwarire ya JavaScript
Emera kwirukana integuza ukoresheje JavaScript:
Cyangwa hamwe data
nibiranga kuri buto mubimenyeshejwe , nkuko byerekanwe hejuru:
Menya ko gufunga integuza bizayikuraho muri DOM.
Uburyo |
Ibisobanuro |
$().alert() |
Kora integuza yumve gukanda ibyabaye kubintu bikomokaho bifite data-dismiss="alert" ikiranga. (Ntabwo ari ngombwa mugihe ukoresheje data-api yo gutangiza-auto.) |
$().alert('close') |
Funga integuza uyikuye muri DOM. Niba i .fade hamwe .show namasomo ahari kuri element, integuza izashira mbere yuko ikurwaho. |
$().alert('dispose') |
Gusenya ikintu cyo kumenyesha. |
Amacomeka ya Bootstrap yerekana ibintu bike byo guhuza ibikorwa.
Icyabaye |
Ibisobanuro |
close.bs.alert |
Ibirori birasa ako kanya mugihe close urugero rwitwa. |
closed.bs.alert |
Ibi birori birukanwa mugihe integuza yafunzwe (izategereza ko CSS ihinduka). |