This commit is contained in:
chenyang
2022-07-02 11:54:44 +08:00
parent 3b394b25ee
commit 50f7a6edf2
2 changed files with 37 additions and 26 deletions
+18
View File
@@ -0,0 +1,18 @@
function common_alert_(text, class_str) {
if (!class_str) {
class_str = 'alert-warning'
}
// reset
$('.alert').alert('close')
// content
const content = `
<div class="alert ${class_str} fade show" role="alert" style="z-index: 2000;position: absolute;top: 0;width: calc(100%);">
${text}
</div>`
// append
$('body').append(content)
// clean
setTimeout(function () {
$('.alert').alert('close')
}, 1500)
}