You can easily achieve this by using basic CSS and then writing a function to “refresh” the value that you assign to the CSS of the page, which will be until the page is loaded / the loading bar is completely opaque, then it will continue to work.
This can be easily achieved using jQuery or JavaScript.
To get information about loading the DOM, you can use Progress Events . The example in the documentation for Progress events is as follows:
<!DOCTYPE html>
<title>Waiting for Magical Unicorns</title>
<progress id="p"></progress>
<script>
var progressBar = document.getElementById("p"),
client = new XMLHttpRequest();
client.open("GET", "magical-unicorns");
client.onprogress = function(pe) {
if(pe.lengthComputable) {
progressBar.max = pe.total;
progressBar.value = pe.loaded;
}
}
client.onloadend = function(pe) {
progressBar.value = pe.loaded;
}
client.send();
</script>
, " " <p> .
, CSS, JavaScript , . document.getElementById("myLoadBar").style.opacity = "0.5";