xxxxxxxxxx
1
<div id="test-full">
2
<button class="btn btn-primary" id="btn-full-screen">Full screen</button>
3
</div>
1
1
xxxxxxxxxx
1
const loader1 = `
2
<div class="loading-full p-4 shadow shadow-3 bg-white rounded-3 border border-2" style="z-index:2000">
3
<div class="spinner-border loading-icon text-succes"></div>
4
<span class="loading-text">Loading...</span>
5
</div>
6
`;
7
8
const btnfull = document.querySelector('#btn-full-screen');
9
10
btnfull.addEventListener('click', () => {
11
const test2 = document.querySelector('#test-full');
12
test2.insertAdjacentHTML('beforeend', loader1);
13
14
const loadingFull = document.querySelector('.loading-full');
15
16
const loading = new mdb.Loading(loadingFull, {
17
delay:2000,
18
scroll: false,
19
backdropID: 'full-backdrop'
20
});
21
22
setTimeout(() => {
23
const backdrop = document.querySelector('#full-backdrop');
24
backdrop.remove();
25
loadingFull.remove();
26
document.body.style.overflow = ''
27
}, 5000);
28
});
Console errors: 0