1
At the event onload
from my site, I carry a function in which makes a loading gif that was appearing, so that the content of the site appears.
<body onload="carregar()">
<div id="preload">
<img src="_imagens/loading.gif">
</div>
<div id="conteudo">
//Aqui tem todo o site, cabeçalhos, rodapés, a interface inteira.
</div>
That’s the job of:
function carregar(){
preload = document.getElementById("preload").style.display = 'none';
div = document.getElementById("conteudo").style.display = 'block';
}
It’s just that things happen so fast, and the effect doesn’t look good. I would like gif to disappear with 0.5s "fade" and content to appear with another fade in the same way. I know this is Jquery, I just don’t know how to do this effect.
How are you creating site content? Is it static HTML? What space does that take
loading.gif
? the whole screen as a layer over the site?– Sergio
It’s static HTML, and this
loading.gif
is centered in the middle of the screen, but is only 200x200 px.– Nicolas S.
If using jQuery is very easy because everything is ready, just use
$('#conteudo').show("slow")
, You can see more examples here: http://api.jquery.com/show/– Ricardo Pontual