使用pace.js加载时隐藏页面 [英] Hide page while loading with pace.js

查看:226
本文介绍了使用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?

推荐答案

我知道这是一篇很老的帖子,但我刚才遇到了这个问题并想出了另一个可能的问题解决方案:)

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

Pace文档中隐藏的是Pace.on()。您可以使用它绑定到文档中列出的事件,如下所示:

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);
});

这篇关于使用pace.js加载时隐藏页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆