I'd like to fade a page in. It should fade in as soon as possible i.e. not wait for images to load.
I have an html page with
<div class="content">
text, images
</div>
I have css like
.content{
opacity:0;
transition: opacity 0.3s ease-in-out;
}
and just above the </body>
I have
$( document ).ready(function() {
$(".content").css("opacity",1);
});
but it feels like a long time loading if a page has lots of images. I thought this was supposed to fire as soon as the DOM is written to the browser?
I tried removing document ready but it was the same. So I was wondering, when is the CSS transition triggered? Is it later than document ready?
The effect I'm going for is for pages to fade up.