18
rated 0 times
[
24]
[
6]
/ answers: 1 / hits: 5194
/ 10 Years ago, sat, june 21, 2014, 12:00:00
I want to block html page until it loads completely with wait image by javascript or CSS but WITHOUT JQUERY
I want to achieve like these demos http://malsup.com/jquery/block/#demos
Please don't suggest with jquery solutions.
HTML code:
<!DOCTYPE html>
<html xmlns=http://www.w3.org/1999/xhtml>
<head>
<title></title>
<script>
var ld = (document.all);
var ns4 = document.layers;
var ns6 = document.getElementById && !document.all;
var ie4 = document.all;
if (ns4)
ld = document.loading;
else if (ns6)
ld = document.getElementById(loading).style;
else if (ie4)
ld = document.all.loading.style;
function init() {
if (ns4) { ld.visibility = hidden; }
else if (ns6 || ie4) ld.display = none;
}
</script>
</head>
<body onload=init()>
//image which has size of 40 mb.
<img src=show.jpg />
<div id=loading style=position:absolute; width:100%; text-align:center; top:300px;>
//loading image to see while loading background image
<img src=loading.gif />
</div>
</body>
</html>
More From » html