Fadeout and removechild at boot
I am new to scripting and I am trying to implement a loading fade screen in a new site.
When I customize the parent div of the loading screen (load_screen) and add fadeout and removeChild, the fadeout looks like I would like, but then reappears instead of being removed. How can I change this code?
<script>
window.addEventListener("load", function(){
var load_screen = document.getElementById("load_screen");
document.body.fadeOut(load_screen);
document.body.removeChild(load_screen);
});
</script>
+3
source to share