When a web page starts loading for the first time browser download images, javascript, CSS and other assets. I want to measure this loading progress by (%) notations.
To do this script I have explored JavaScript's window.onload
but I didn't get any properties & methods as required.
function load() {
var preload = document.querySelector('#magic-box');
preload.style.display="none";
}
window.onload = load;
window.onload pretty enough for creating a simple preloader for the webpage. In the GitHub & Codepen there are a lot of percentage preloaders. But they are not calculating the absolute percent, They are modified & static. If we can measure webpages elements loading progress we can make an awsome & cool preloader