On my Wix site, DoorJam Creations, I created a custom preloader using a custom code. Even though I have it set on “All pages” and “Load code on each new page,” it just appears when I first go to the home page and not when I click on any other links. I’ve tried setting it to “Load only once” with the same result. The preloader, however, also appears on my Internet Archive saves of different pages. Does anybody have any solutions for this?
For completion’s sake, here’s the code:
<div class="preloader">
<img src="https://static.wixstatic.com/media/2c2b91_0932f302eb02465592031b5948cfd6f9~mv2.gif" alt="safe" class="preloader"></img>
</div>
<style>
/* Preloader Section class */
.preloader{
position: relative;
width: 100%;
height: 100vh;
z-index: 1001;
text-align: center;
background-color: #000000; /* Preloader Background */
margin: auto;
}
/* Preloader Image style */
.preloader img{
max-width: 200px; /* width of preloader image */
width: 38%;
height: auto;
margin: auto;
text-align: center;
display: block;
top: 40%;
}
</style>
<script>
//after window is loaded completely
window.onload = function(){
//hide the preloader
document.querySelector(".preloader").style.display = "none";
}
</script>