Na nyaŋuɖoɖo ƒe gbedasi siwo ku ɖe nya siwo ƒo xlãe ŋu na zãla ƒe nuwɔna siwo bɔ kple nuxlɔ̃ame gbedasi ʋɛ siwo li eye woate ŋu atrɔ asi le wo ŋu.
Kpɔɖeŋuwo
Nuxlɔ̃amewo li na nuŋɔŋlɔ ƒe didime ɖesiaɖe, kpakple asiɖeɖe le eŋu ƒe dzesi si woate ŋu atia. Ne èdi be yeawɔ atsyã nyuie la, zã nya siwo ƒo xlãe ƒe klass enyi siwo hiã.alert-success la dometɔ ɖeka (le kpɔɖeŋu me, ). Ne èdi be yeaɖe asi le fli me ŋu la, zã nuxlɔ̃amewo jQuery plugin .
Nuxlɔ̃ame gbãtɔ bɔbɔe aɖe—kpɔe ɖa!
Nuxlɔ̃ame evelia bɔbɔe aɖe—kpɔe ɖa!
Dzidzedzekpɔkpɔ ŋuti nuxlɔ̃ame bɔbɔe aɖe—kpɔe ɖa!
Afɔku ŋuti nuxlɔ̃ame bɔbɔe aɖe—kpɔe ɖa!
Nuxlɔ̃ame ƒe nuxlɔ̃ame bɔbɔe aɖe—kpɔe ɖa!
Nyatakaka ƒe nuxlɔ̃ame bɔbɔe aɖe—kpɔe ɖa!
Kekeli ƒe nuxlɔ̃ame bɔbɔe aɖe—kpɔe ɖa!
Viviti ƒe nuxlɔ̃ame bɔbɔe aɖe—kpɔe ɖa!
Gɔmesese nana mɔ̃ɖaŋununya siwo kpena ɖe ame ŋu
Amadede zazã atsɔ akpe ɖe gɔmesese ŋu koe naa nukpɔkpɔ ƒe dzesi aɖe, si womagblɔ na kpekpeɖeŋunamɔ̃wo zazãlawo o – abe screen readers ene. Kpɔ egbɔ be nyatakaka siwo wotsɔ amadedea de dzesii la dze ƒã tso emenyawo ŋutɔ me (le kpɔɖeŋu me, nuŋɔŋlɔ si wokpɔna), alo wotsɔe de eme to mɔnu bubuwo dzi, abe nuŋɔŋlɔ bubu siwo woɣla kple .sr-onlyklass la ene.
Kadodo ƒe amadede
Zã .alert-linkutility class la nàtsɔ ana kadodo siwo ƒe amadede sɔ kple wo nɔewo kaba le nuxlɔ̃ame ɖesiaɖe me.
Aww yeah, èxlẽ nuxlɔ̃ame gbedasi vevi sia dzidzedzetɔe. Kpɔɖeŋu nuŋɔŋlɔ sia le du dzi vie ale be nàte ŋu akpɔ alesi dometsotso le nuxlɔ̃ame me wɔa dɔ kple nya sia ƒomevi.
Ɣesiaɣi si wòahiã la, kpɔ egbɔ be yezã margin utilities be nuwo nanɔ nyuie eye woanɔ ɖoɖo nu.
Nyaɖeɖe le dɔ me
Ne èzã nuxlɔ̃ame JavaScript ƒe kpeɖeŋutɔ la, àte ŋu agbe nuxlɔ̃ame ɖesiaɖe le fli me. Ale si nàwɔe nye esi:
Kpɔ egbɔ be yetsɔ nuxlɔ̃ame ƒe kpeɖeŋutɔa, alo Bootstrap JavaScript si woƒo ƒu la de eme.
Ne èle míaƒe JavaScript tum tso dzɔtsoƒe la, ebia beutil.js . Esia le gɔmeɖeɖe si woƒo ƒu la me.
Tsɔ asiɖeɖe le nu ŋu ƒe abɔta kple .alert-dismissibleklass la kpe ɖe eŋu, si naa nu bubu aɖe kpena ɖe nuxlɔ̃amea ƒe ɖusime eye wòɖoa .closeabɔta la ɖe teƒe.
Le dismiss ƒe dzesi dzi la, tsɔ data-dismiss="alert"attribute la kpee, si aʋã JavaScript ƒe dɔwɔwɔ. Kpɔ egbɔ be yezã <button>element la kplii hena nuwɔna nyuitɔ le mɔ̃wo katã dzi.
Be nàna nuxlɔ̃amewo nawɔ dɔ ne èle wo ɖem ɖa la, kpɔ egbɔ be yetsɔ .fadekple .showklassawo kpee.
Àte ŋu akpɔ esia le dɔwɔwɔ me kple live demo:
Guacamole kɔkɔe la! Ele be nàlé ŋku ɖe akpa mawo dometɔ aɖewo siwo le ete la ŋu.
JavaScript ƒe nuwɔna
Nusiwo ʋãa ame
Na nuxlɔ̃ame aɖe ɖeɖeɖa to JavaScript dzi nawɔ dɔ:
Alo kple datanɔnɔmewo le abɔta aɖe dzi le nuxlɔ̃amea me , abe alesi woɖee fia le etame ene:
De dzesii be ne ètu nuxlɔ̃ame aɖe la, aɖee ɖa le DOM la me.
Mɔnuwo
Nuwɔmɔnu
Nuɖᴐɖᴐ
$().alert()
Ewɔa nuxlɔ̃ame ɖoa to na ʋuʋu nudzɔdzɔwo le dzidzimeviwo ƒe akpa siwo si data-dismiss="alert"nɔnɔmea le. (Mehiã ne èle data-api ƒe auto-initialization zãm o.)
$().alert('close')
Etua nuxlɔ̃ame aɖe to eɖeɖe le DOM la me. Ne .fadekple .showklasswo le element la dzi la, nuxlɔ̃amea nu ayi hafi woaɖee ɖa.