xxxxxxxxxx
1
<div
2
class="toast show fade text-white mx-auto"
3
role="alert"
4
aria-live="assertive"
5
aria-atomic="true"
6
data-mdb-color="success"
7
data-mdb-delay="2000"
8
data-mdb-position="top-right"
9
data-mdb-stacking="true"
10
id="position-example-toast"
11
>
12
<div class="toast-header text-white">
13
<i class="fas fa-check fa-lg me-2"></i>
14
<strong class="me-auto">MDBootstrap</strong>
15
<small>11 mins ago</small>
16
<button
17
type="button"
18
class="btn-close btn-close-white"
19
data-mdb-dismiss="toast"
20
aria-label="Close"
21
></button>
22
</div>
23
<div class="toast-body">
24
<p>New achievement Unlocked!</p>
25
<small>this toast is on the top left not the top right.</small>
26
</div>
27
</div>
1
1
xxxxxxxxxx
1
const instance = mdb.Toast.getInstance(document.getElementById('position-example-toast'));
2
instance.update({ position: 'top-right', });
Console errors: 0