aboutsummaryrefslogtreecommitdiff
path: root/app/cdn/js/loading.js
diff options
context:
space:
mode:
Diffstat (limited to 'app/cdn/js/loading.js')
-rw-r--r--app/cdn/js/loading.js32
1 files changed, 32 insertions, 0 deletions
diff --git a/app/cdn/js/loading.js b/app/cdn/js/loading.js
new file mode 100644
index 0000000..b3970de
--- /dev/null
+++ b/app/cdn/js/loading.js
@@ -0,0 +1,32 @@
+document.onreadystatechange = function(e) {
+ if (document.readyState == "interactive") {
+ var all = document.getElementsByTagName("*");
+ for (var i = 0, max = all.length; i < max; i++) {
+ set_ele(all[i]);
+ }
+ }
+}
+
+function check_element(ele) {
+ var all = document.getElementsByTagName("*");
+ var totalele = all.length;
+ var per_inc = 100 / all.length;
+
+ if ($(ele).on()) {
+ var prog_width = per_inc + Number(document.getElementById("progress_width").value);
+ document.getElementById("progress_width").value = prog_width;
+ $("#bar1").animate({
+ width: prog_width + "%"
+ }, 10, function() {
+ if (document.getElementById("bar1").style.width === "100%") {
+ $(".progress").fadeOut("slow");
+ }
+ });
+ } else {
+ set_ele(ele);
+ }
+}
+
+function set_ele(set_element) {
+ check_element(set_element);
+} \ No newline at end of file