I first want to tell you guys that I am extremely new to web designing, so i was experimenting and I really wanted to learn how to create a preloader with a gif before the page load. I tried, but every time, it either continually show the preloader and not the actual site, or doesn't show the preloader at all. Im not sure if i didnt download somethings or it's the program I'm using which is notepad++ but i dont know what im doing wrong. And i followed every examples to do it, but nothing work. Here is my html file
<html>
<head>
<meta charset = "uft-8">
<title>Tester</title>
<link href =" test.css" type = "text/css" rel = "stylesheet">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script type = "text/javascript"></script>
<script>
$(document).ready(function() {
$(window).load(function() {
preloaderFadeOutTime = 500;
function hidepreloader() {
var preloader = $('.tester');
preloader.fadeOut(preloaderFadeOutTime);
}
hidepreloader();
});
});
</script>
</head>
<body>
<div class = "tester"></div>
<div class = "overlay"></div>
</div>
<div class = "wrapper">
<div class = "heading">
<h1> My page</h1>
</div>
<div class = "navigation">navigation</div>
<div class = " content">main content</div>
<div class = "sidebar">addition</div>
<div class = "footer">this is an experiment</div>
</div>
</body>
</html>
And this is my CSS file
#tester {
height: 100%;
width: 100%;
background: rgba(0,0,0,.8);
position: fixed;
left: 0;
top: 0;
}
#overlay {
position: fixed;
left: 0px;
top: 0px;
width: 100%;
height: 100%;
z-index: 9999;
background: url(../downloads/Giphy.gif) 50% 50% no-repeat rgb(249,249,249);
}
.wrapper {
background: #000000;
width: 600px;
margin: 0 auto 0 auto;
}
.heading {
height: 100px;
background: green;
text-align:center;
padding: 20px;
}
.navigation {
height: 50px;
background: lightgreen;
}
.content {
min-height: 400px;
background-image: url(../downloads/test.jpg);
width: 400px;
float: left;
}
.sidebar {
width: 200px;
float: right;
background:lightblue;
min-height: 400px;
}
.footer {
clear: both;
background: black;
height: 40px;
color: white;
text-align: center;
padding: 10px;
}
h1 {
text-align: center;
font-family: "times new roman"
font: 24pt;
color: #ff3819;
}