1
0
mirror of https://github.com/twbs/bootstrap.git synced 2025-08-22 05:03:16 +02:00

Add a live toast example to the docs (#32760)

This commit is contained in:
Mark Otto
2021-01-18 05:10:01 -08:00
committed by GitHub
parent bb19b08fbe
commit 4167c107f8
2 changed files with 51 additions and 1 deletions

View File

@@ -39,7 +39,7 @@
})
}
document.querySelectorAll('.toast')
document.querySelectorAll('.bd-example .toast')
.forEach(function (toastNode) {
var toast = new bootstrap.Toast(toastNode, {
autohide: false
@@ -48,6 +48,16 @@
toast.show()
})
var toastTrigger = document.getElementById('liveToastBtn')
var toastLiveExample = document.getElementById('liveToast')
if (toastTrigger) {
toastTrigger.addEventListener('click', function () {
var toast = new bootstrap.Toast(toastLiveExample)
toast.show()
})
}
// Demos within modals
document.querySelectorAll('.tooltip-test')
.forEach(function (tooltip) {