Hāʻawi i nā memo manaʻo hoʻopuka no nā hana maʻamau o ka mea hoʻohana me ka liʻiliʻi o nā memo makaʻala i loaʻa a maʻalahi.
Nā laʻana
Loaʻa nā mākaʻikaʻi no kēlā me kēia lōʻihi o ke kikokikona, a me kahi pihi hoʻokuʻu koho. No ke kāhiko pono ʻana, e hoʻohana i kekahi o nā ʻewalu mau papa pōʻaiapili i koi ʻia (e laʻa, .alert-success). No ka hoʻokuʻu ʻana i ka laina, e hoʻohana i ka plugin jQuery alerts .
He makaʻala mua maʻalahi—e nānā iā ia!
He makaʻala maʻalahi maʻalahi—e nānā iā ia!
ʻO kahi makaʻala kūleʻa maʻalahi—e nānā iā ia!
ʻO kahi makaʻala pilikia maʻalahi - e nānā iā ia!
ʻO kahi makaʻala maʻalahi - e nānā iā ia!
He makaʻala ʻike maʻalahi—e nānā iā ia!
ʻO kahi makaʻala māmā maʻalahi - e nānā iā ia!
ʻO kahi makaʻala pōʻeleʻele maʻalahi - e nānā iā ia!
Ka lawe ʻana i ka manaʻo i nā ʻenehana kōkua
ʻO ka hoʻohana ʻana i ke kala e hoʻohui i ka manaʻo e hāʻawi wale i kahi hōʻailona ʻike, ʻaʻole e hāʻawi ʻia i nā mea hoʻohana i nā ʻenehana kōkua - e like me nā mea heluhelu pale. E hōʻoia i ka ʻike i hōʻike ʻia e ka waihoʻoluʻu i ʻike ʻia mai ka maʻiʻo ponoʻī (e laʻa i ke kikokikona ʻike ʻia), a i ʻole e hoʻokomo ʻia ma o nā ala ʻē aʻe, e like me nā kikokikona hou i hūnā ʻia me ka .sr-onlypapa.
kala loulou
E hoʻohana i ka .alert-linkpapa hana pono e hāʻawi koke i nā loulou kala like ʻole i loko o kekahi makaʻala.
He makaʻala mua maʻalahi me
kahi loulou laʻana . E hāʻawi i kahi kaomi inā makemake ʻoe.
He makaʻala maʻalahi lua me
kahi loulou laʻana . E hāʻawi i kahi kaomi inā makemake ʻoe.
He makaʻala kūleʻa maʻalahi me
kahi loulou laʻana . E hāʻawi i kahi kaomi inā makemake ʻoe.
He makaʻala maʻalahi me
kahi loulou laʻana . E hāʻawi i kahi kaomi inā makemake ʻoe.
ʻO kahi makaʻala maʻalahi me
kahi loulou laʻana . E hāʻawi i kahi kaomi inā makemake ʻoe.
He makaʻala ʻike maʻalahi me
kahi loulou laʻana . E hāʻawi i kahi kaomi inā makemake ʻoe.
ʻO kahi makaʻala māmā māmā me
kahi loulou laʻana . E hāʻawi i kahi kaomi inā makemake ʻoe.
He makaʻala ʻeleʻele maʻalahi me
kahi loulou laʻana . E hāʻawi i kahi kaomi inā makemake ʻoe.
ʻO nā mea hou aku
Hiki ke loaʻa i nā ʻōlelo aʻoaʻo nā mea HTML hou e like me nā poʻo, nā paukū a me nā mea hoʻokaʻawale.
Hana maikaʻi!
ʻAe, heluhelu pono ʻoe i kēia memo makaʻala nui. E holo lōʻihi ana kēia laʻana kikokikona i hiki iā ʻoe ke ʻike i ke ʻano o ka hana ʻana o ke kaawale i loko o kahi makaʻala me kēia ʻano ʻike.
I kēlā me kēia manawa āu e pono ai, e hoʻohana pono i nā pono hana e mālama i nā mea maikaʻi a maʻemaʻe.
Hoʻokuʻu
Me ka hoʻohana ʻana i ka plugin JavaScript makaʻala, hiki ke hoʻokuʻu i kekahi makaʻala inline. Penei:
E ʻike pono ua hoʻouka ʻoe i ka plugin alert, a i ʻole ka Bootstrap JavaScript i hōʻuluʻulu ʻia.
Inā ʻoe e kūkulu nei i kā mākou JavaScript mai ke kumu, ponoutil.js ia . ʻO ka mana i hui pū ʻia me kēia.
E hoʻohui i kahi pihi hoʻokuʻu a me ka .alert-dismissiblepapa, e hoʻohui i ka padding hou ma ka ʻākau o ka makaʻala a hoʻonoho i ke .closepihi.
Ma ke pihi hoʻokuʻu, hoʻohui i ke data-dismiss="alert"ʻano, ka mea e hoʻomaka ai i ka hana JavaScript. E hoʻohana pono i ka <button>mea me ia no ka hana kūpono ma nā ʻaoʻao āpau.
No ka hoʻoulu ʻana i nā mākaʻikaʻi i ka wā e haʻalele ai iā lākou, e hōʻoia e hoʻohui i nā papa .fadea me .shownā papa.
Hiki iā ʻoe ke ʻike i kēia i ka hana me kahi demo ola:
Guacamole hemolele! Pono ʻoe e nānā i kekahi o ia mau kahua ma lalo nei.
ʻO ka hana JavaScript
Nā mea hoʻoulu
E ʻae i ka wehe ʻana i kahi makaʻala ma o JavaScript:
A i ʻole me datanā ʻano ma ke pihi i loko o ka makaʻala , e like me ka mea i hōʻike ʻia ma luna nei:
E hoʻomaopopo ʻo ka pani ʻana i kahi makaʻala e wehe ia mai ka DOM.
Nā ʻano hana
Kaʻina hana
wehewehe
$().alert()
E hoʻolohe i nā hanana kaomi ma nā ʻano mamo nona ka data-dismiss="alert"ʻano. (ʻAʻole pono i ka wā e hoʻohana ai i ka hoʻomaka ʻana o ka data-api.)
$().alert('close')
Pani i kahi makaʻala ma ka wehe ʻana iā ia mai ka DOM. Inā loaʻa ka .fadea me .shownā papa ma ka mea, e mae ka makaʻala ma mua o ka wehe ʻana.
$().alert('dispose')
Hoʻopau i ka makaʻala o kahi mea.
Nā hanana
Hōʻike ka plugin alert a Bootstrap i kekahi mau hanana no ka hoʻopili ʻana i ka hana makaʻala.
Hanana
wehewehe
close.bs.alert
Hoʻomaka koke kēia hanana i ke closekāhea ʻia ʻana o ke ʻano hana.
closed.bs.alert
Hoʻopau ʻia kēia hanana i ka wā i pani ʻia ai ka makaʻala (e kali no ka hoʻopau ʻana o CSS).