HTML
Add the following HTML after opening the tag. This loader div will show the loaded image when the page loads.
<div class="pageloader"></div>
CSS
.pageloader {
position: fixed;
left: 0px;
top: 0px;
width: 100%;
height: 100%;
z-index: 9999;
background: url('images/yourLoaderImage.gif') 50% 50% no-repeat rgb(249,249,249);
opacity: .8;
}
Javascript
First enable the jQuery library.
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.4/jquery.min.js"></script>
Now add the following line of code to hide the uploaded image while the page is loading fully.
<script type="text/javascript">
$(window).load(function() {
$(".pageloader").fadeOut("slow");
});
</script>
It works completely for me.
source
share