-2

I have a bit of code that acts as a preloader that displays until all JS has loaded. The only problem is I see the preloader appear over the top of the content coming in to the page.

How do I adjust the code below to fade out the '#loading-mask' div, pause with a blank screen for .5 of a second then fade in my page content?

The primary goal is to stop the two from overlapping

Here's my code:

$('#loading-mask').fadeOut();
egr103
  • 3,858
  • 15
  • 68
  • 119

1 Answers1

0
$('#loading-mask').fadeOut(500, function() {
    setTimeout(500);
    $('#content').fadeIn()
});
Kyri Elia
  • 997
  • 9
  • 18