The technique behind showing a gif loader before page loads completely is very easy. Basically what it is doing ?
It is first displayed as a normal div but with the condition of jquery it will hide when the browser is completely loads. Similarly it will add a class to website container that makes it visible.
$(window).load(function() {
$("#spinner").fadeOut("slow");
})
<div id="spinner"></div>