HTML LOADING
Source Code:
<!DOCTYPE html>
<html>
<head><style>
body {
font-family:"Arial", cursive;
}
#page {
display: none;
}
#loading {
display: block;
position: absolute;
top: 0;
left: 0;
z-index: 100;
width: 100vw;
height: 100vh;
background-color: black;
background-image: url("https://upload.wikimedia.org/wikipedia/commons/e/ee/Loadinginjg.gif");
background-repeat: no-repeat;
background-position: center;
}
</style></head>
<body>
<script>
function onReady(callback) {
var intervalID = window.setInterval(checkReady, 1000);
function checkReady() {
if (document.getElementsByTagName('body')[0] !== undefined) {
window.clearInterval(intervalID);
callback.call(this);
}
}
}
function show(id, value) {
document.getElementById(id).style.display = value ? 'block' : 'none';
}
onReady(function () {
show('page', true);
show('loading', false);
});
</script>
<div id="page">
</div>
<div id="loading"></div>
</body>
</html>
Refresh for Output
Comments
Post a Comment