I have a loading icon, which is supposed load after clicking a button. I want all the background element of the icon fade, to create a pure loading feel. Whats the easiest way to do that?
EDIT: I all other elements to be fade, not just the background image.
$("#show").on("click",function(){
$(".page-loader-indiv").show();
});
$(".page-loader-indiv").hide();
.page-loader-indiv{
position: fixed;
left: 0px;
top: 0px;
width: 100%;
height: 100%;
z-index: 99999;
background: transparent url(http://web.codeevents.xyz/img/page-loader.gif) center center no-repeat;
}
body{
background:url(http://web.codeevents.xyz/img/Desserts.jpg);
color:white;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<div>
This is some content
This is more content
</div>
<div class = "page-loader-indiv">
</div>
<div>
Click here to show loader
<button id ="show" >Show Loader</button>
</div>