#loading-percentage and overlay class is .loading-overlay.Displaying a dynamic page load percentage in Webflow involves adding a custom script. Here's how you can approach it:
<head> or before </body> tags:
```javascript
document.addEventListener("DOMContentLoaded", function () {
const textElement = document.querySelector('#loading-percentage'); // Ensure the element has this ID
let loaded = 0;
let total = 100; // This is an approximation as actual resource tracking would involve a more complex setup
const interval = setInterval(() => {
if (loaded < total) {
loaded += 1; // Increment load percentage
if (textElement) {
textElement.innerText = ${loaded}%;
}
} else {
clearInterval(interval);
document.querySelector('.loading-overlay').style.display = 'none'; // Hide overlay when loading finishes
}
}, 50); // Adjust the speed based on your needs
});
```
#loading-percentage..loading-overlay in the script.
To dynamically display the page load percentage, you need to set up a loading overlay with a text block and utilize a simple script that updates this text. Customize the IDs and styles to match your design. This script provides a simulated percentage, as true resource tracking requires a more complex solution.