xxxxxxxxxx
1
<div id="stacking-container">
2
3
</div>
1
1
xxxxxxxxxx
1
let stackCount = 0;
2
3
function showToast(title, text) {
4
stackCount++;
5
6
const toast = document.createElement('div');
7
toast.innerHTML = `
8
<div class="toast-header">
9
<strong class="me-auto">${stackCount}</strong>
10
<small>11 mins ago</small>
11
<button
12
type="button"
13
class="btn-close"
14
data-mdb-dismiss="toast"
15
aria-label="Close"
16
></button>
17
</div>
18
<div class="toast-body text-start">
19
Stacking element
20
</div>
21
`;
22
23
toast.classList.add('toast', 'fade');
24
25
document.getElementById('stacking-container').appendChild(toast);
26
/*this is line 102*/
27
const toastInstance = new mdb.Toast(toast, {
28
stacking: true,
29
hidden: true,
30
width: '450px',
31
position: 'top-right',
32
container: '#stacking-container',
33
autohide: true,
34
delay: 5000,
35
});
36
37
toastInstance.show();
38
};
39
40
showToast('a', 'a')
41
showToast('a', 'a')
42
showToast('a', 'a')
43
showToast('a', 'a')
Console errors: 0