How to add loading spinner image(page load images) in php using javascript


PHP Code:-

<html>
<head>

function preloader(){
document.getElementById(“loading”).style.display = “none”;
document.getElementById(“load_images”).style.display = “none”;
document.getElementById(“contents”).style.display = “block”;
}//preloader
window.onload = preloader;

<style>
#load_images{ background-color: #000000;
display: block;
height: 100%;
left: 0;
opacity: 0.6;
position: fixed;
top: 0;
width: 100%;
z-index: 9999;}
div#contents {
display: block;
}
#loading {
top: 50%;
left: 50%;
position: absolute;
cursor: wait;
}
</style>
</head>
<body>

<input type=”submit”>

Your Contain here……

</body>
</html>

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s