直到页面完全加载

直到页面完全加载

本文介绍了如何显示网页上的进度条,直到页面完全加载?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想显示在网页中的进度条/加载弹出,直至页面完全加载。

I would like to show a progress bar/loading popup in a web page until the page is fully loaded.

我的网页是沉重的,因为它包含在它的HTML编辑器,这是一个基于jQuery的HTML编辑器,需要花费大量的时间来完全负载。虽然它加载,我要展示我的网页上的进度条,这将让刚刚拆除后,我的整个页面加载完毕。

My web page is heavy because it contains an HTML editor in it, which is a jQuery based HTML editor that takes a lot of time to completely load. While it is loading, I wish to show a progress bar on my page which will get removed just after my whole page has finished loading.

推荐答案

不知道如何显示进度条。结果
但显示加载弹出很容易使用结果
刚才提到了jQuery和BlockUi插件头标签内。

Don't know how to show a progress bar.
But showing a loading popup is easy using jQuery BlockUI Plugin
Just reference the jQuery and the BlockUi Plugin inside the head tag.

做这样的事情呢。

$(document).ready(function() {
    // block page
    $.blockUI();
    //load your editor here
    //after load complete unblock page
    $.unblockUI();
});

更妙的是,如果你使用的是类似的CKEditor,您可以在CKEditor的负荷完成后回调解锁页面。

Better still if you are using something like CKEditor, you can unblock the page after the load complete callback of the ckeditor.

下面是一个小例子,有被封锁10秒的页面。您可以在回调设置相同。 ()

Here is a small example with a page being blocked for 10 seconds. You can set the same at your callback. ( Example Here )

这篇关于如何显示网页上的进度条,直到页面完全加载?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-30 23:39