I'm looking to make a website that slowly fades in to hide the loading of the images. Now I've managed to get some javascript that does the fade in but it starts immediatly when the page loads so you still see the individual elements loading when you load the page.
What I would like to do is to add a delay of a second or so before it starts fading in.
Here is what i've got now:
<style>fadein{filter:alpha(opacity=0);opacity:0}</style>
<script>
function fadein(){var fade=0, fadein=document.getElementById("index-wrappper").style,ms=(fadein.opacity==0)?0:1, pace=setInterval(Fade,20);
function Fade() {if(fade<100){fade+=1;if(ms)fadein.filter="alpha(opacity="+fade+")";else fadein.opacity=(fade/100)} else clearInterval(pace)}};
window.onload=fadein;
</script>
I suspect that I need to add the delay in Function fade somehow since Fadein is what set the opacity of the div to 0 on load.
But what exactly do i need to put there? I have slim to none javascript knowledge (which i really need to brush up) and would really appreciate any help with this.