I have a background of 2mb to do preload and I do not know how to do it ... I already tried the basics, for example:
$ ("#image"). load (function () {
}
I have a background of 2mb to do preload and I do not know how to do it ... I already tried the basics, for example:
$ ("#image"). load (function () {
}
I understand that you want to show your site only when all images are loaded. So just use:
$(window).load(function() { $('.principal').show(); })
Or
$('body').load(function() { $('.principal').show(); })
If you do not want your site to appear until it is 100% loaded. you can leave a loading div and another one with all the content of the site inside where the one of the site starts hidden.
CSS:
.principal { display: none; }
HTML:
<div class="carregando">Carregando...</div>
<div class="principal"></div>