Toasts
Toasts are lightweight notifications designed to mimic the push notifications that have been popularized by mobile and desktop operating systems.
css class | description |
---|---|
toast | Specifies toast. |
toast-header | Specifies a header section of toast. |
toast-body | Specifies a body section of toast. |
Code example
Bootstrap
11 mins ago
Hello, world! This is a toast message.
methods
method | descripton |
---|---|
toast(options) | Attaches a toast handler to an element collection. Accepts an optional options object, that can have following properties:
|
toast('show') | Shows a toast. |
toast('hide') | Hides a toast. |
toast('dispose') | Destroys a toast. |
$('#element').toast('show');
$('#element').toast('hide');
$('#element').toast('dispose');
events
event name | descripton |
---|---|
show.bs.toast | Fires immediately when the show() method is called. |
shown.bs.toast | Fires when the toast has been made visible to the user. |
hide.bs.toast | Fires immediately when the hide() method is called. |
hidden.bs.toast | Fires when a toast has been hidden from the user. |
$('#myToast').on('hidden.bs.toast', function () {
// do something...
})