I built something like this.
First place #preloader in HTML on a div like this
<div id="preloader"></div>
If you want, you can place the gif inside.
Then set up some CSS:
#preloader { background: #FFF; bottom: 0; left: 0; position: fixed; right: 0; top: 0; z-index: 9999; }
Now make a few script as follows:
$(window).load(function() { $('#preloader').delay(350).fadeOut('slow'); }); $('a').click(function(e){ e.preventDefault(); t = $(this).attr('href'); $('#preloader').delay(350).fadeIn('slow',function(){ window.location.href = t; }); });
And you're done :)
The first part is to make your preloader visible when the window loads, and then fadeOut.
Secondly, attach a click to the firework for fadeIn preloader and redirect to the architect href.
source share