Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Hide page while loading with pace.js

I'm working with pace, a page loader, and it works fine. But I can't seem to figure out how to hide the entire page except for the loading bar while the page loads, and show it once the loading completes. Any ideas?

like image 243
user3052215 Avatar asked Mar 09 '14 14:03

user3052215


2 Answers

I know this is kind of an old post but I ran into this issue just now and figured out another possible solution :)

Hidden in the Pace documentation is Pace.on(). You can use it to bind to the events listed in the docs, like so:

Pace.on("done", function(){
    $(".cover").fadeOut(2000);
});
like image 66
julianwyz Avatar answered Sep 19 '22 14:09

julianwyz


I resolved this using the following code.

.pace-running > *:not(.pace) {
  opacity:0;
}

as display:none was causing an issue with alignment in the google maps on the page. this works perfectly and need to add a bit of transition to this.

like image 24
Jakki Avatar answered Sep 19 '22 14:09

Jakki