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:
@@ -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) {
|
||||
|
Reference in New Issue
Block a user