Bootstrap 4 | Toast
Toast is used to create something like an alert box which is shown for a short time like a couple of seconds when something happens. Like when the user clicks on a button or submits a form and many other actions.
- .toast: It helps to create a toast
- .toast-header : It helps to create the toast header
- .toast-body : It helps to create toast body
- .toast(options): It helps to activate the toast with a parameter of option. In the below implementation we remove the fading transition effect from the toast, and we delay the hiding of the toast to 8000 milliseconds when it is shown. It has three options animation, autohide, delay. Refer this link for more information on these options.
- .toast(“show”): It shows the toast
- .toast(“hide”): It hides the toast
- .toast(“dispose”): It disposes the toast
show.bs.toast : It happens when the toast is about to be shown.
shown.bs.toast : It happens when the toast is shown.
hide.bs.toast : It happens when the toast is about to be hidden.
hidden.bs.toast : It happens when the toast is fully hidden.
- Google Chrome
- Internet Explorer
Attention reader! Don’t stop learning now. Get hold of all the important HTML concepts with the Web Design for Beginners | HTML course.