बूटस्ट्रैप जे एस टोस्ट
टोस्ट सीएसएस क्लासेस
टोस्ट घटक एक अलर्ट बॉक्स की तरह है जो कुछ होने पर केवल कुछ सेकंड के लिए दिखाया जाता है (यानी जब उपयोगकर्ता बटन पर क्लिक करता है, फॉर्म सबमिट करता है, आदि)।
टोस्ट के बारे में एक ट्यूटोरियल के लिए, हमारा बूटस्ट्रैप टोस्ट ट्यूटोरियल पढ़ें ।
Class | Description | Example |
---|---|---|
.toast |
Creates the toast | |
.toast-header |
Creates the toast header | |
.toast-body |
Creates the toast body |
जावास्क्रिप्ट के माध्यम से सक्रिय करें
टोस्ट को jQuery के साथ इनिशियलाइज़ किया जाना चाहिए: निर्दिष्ट तत्व का चयन करें और toast()
विधि को कॉल करें।
उदाहरण
<script>
$(document).ready(function(){
$('.toast').toast('show');
});
</script>
टोस्ट विकल्प
विकल्प डेटा विशेषताओं या जावास्क्रिप्ट के माध्यम से पारित किए जा सकते हैं। डेटा विशेषताओं के लिए, विकल्प नाम को में जोड़ें 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) |