-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
23 lines (17 loc) · 744 Bytes
/
script.js
File metadata and controls
23 lines (17 loc) · 744 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
function waitForBackgroundToLoad() {
var background = document.querySelector('.background');
function checkIfBackgroundIsLoaded() {
// The background element has loaded
// Show the content
var content = document.querySelector('.content');
content.style.display = 'block';
// Optionally, you can add animations or other actions here for the content
}
background.addEventListener('load', checkIfBackgroundIsLoaded);
// Check if the background is already loaded (in case it is cached)
if (background.complete) {
checkIfBackgroundIsLoaded();
}
}
// Call the function to start the process when the page loads
window.addEventListener('load', waitForBackgroundToLoad);