Bootstrap JS Toasts
CSS အတန်းများကို ဆန္ဒပြုပါ။
Toast အစိတ်အပိုင်းသည် တစ်ခုခုဖြစ်သွားသောအခါတွင် စက္ကန့်အနည်းငယ်မျှသာ ပြသထားသည့် သတိပေးဘောက်စ်တစ်ခုနှင့် တူသည် (ဆိုလိုသည်မှာ အသုံးပြုသူသည် ခလုတ်တစ်ခုကို နှိပ်လိုက်သည့်အခါ၊ ဖောင်တင်ခြင်း စသည်ဖြင့်)။
Toasts အကြောင်း သင်ခန်းစာအတွက်၊ ကျွန်ုပ်တို့၏ Bootstrap Toast Tutorial ကို ဖတ်ရှုပါ ။
Class | Description | Example |
---|---|---|
.toast |
Creates the toast | |
.toast-header |
Creates the toast header | |
.toast-body |
Creates the toast body |
JavaScript မှတဆင့် အသက်သွင်းပါ။
Toasts များကို jQuery ဖြင့် အစပြုရပါမည် toast()
။
ဥပမာ
<script>
$(document).ready(function(){
$('.toast').toast('show');
});
</script>
Toast ရွေးစရာများ
ရွေးချယ်စရာများကို data attribute သို့မဟုတ် JavaScript မှတဆင့်ဖြတ်သန်းနိုင်သည်။ data-
ဒေတာရည်ညွှန်းချက်များအတွက် ၊ တွင်ပါရှိသည့်အတိုင်း ရွေးချယ်စရာအမည်ကို ပေါင်းထည့် ပါ data-animation=""
။
Name | Type | Default | Description | Try it |
---|---|---|---|---|
animation | boolean | true |
Specifies whether to add a CSS fade transition effect when showing and hiding the toast.
|
|
autohide | boolean | true | Specifies whether to hide the toast by default | |
delay | number | 500 | Specifies the number of milliseconds it will take to hide the toast once it is shown. |
ကြော်နည်းများ
အောက်ပါဇယားတွင် ရရှိနိုင်သော ကင်ပွန်းတပ်နည်းလမ်းများအားလုံးကို စာရင်းပြုစုထားသည်။
Method | Description | Try it |
---|---|---|
.toast(options) | Activates the toast with an option. See options above for valid values | |
.toast("show") | Shows the toast | |
.toast("hide") | Hides the toast | |
.toast("dispose") | Hides and destroys the toast |
ဆန္ဒပြုပွဲများ
အောက်ဖော်ပြပါ ဇယားတွင် ရရှိနိုင်သော ဆန္ဒပြုပွဲများအားလုံးကို စာရင်းပြုစုထားသည်။
Event | Description | Try it |
---|---|---|
show.bs.toast | Occurs when the toast is about to be shown | |
shown.bs.toast | Occurs when the toast is fully shown (after CSS transitions have completed) | |
hide.bs.toast | Occurs when the toast is about to be hidden | |
hidden.bs.toast | Occurs when the toast is fully hidden (after CSS transitions have completed) |