-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathloader.js
More file actions
37 lines (34 loc) · 737 Bytes
/
Copy pathloader.js
File metadata and controls
37 lines (34 loc) · 737 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
/**
* @callback cbFunction
* @returns {void}
*/
/**
*
* @param {string} selector
* @param {cbFunction} [onLoad=null]
*/
export function moveOut(selector, onLoad) {
$(selector).fadeOut("medium", onLoad);
$("#indicator").fadeIn("medium");
}
/**
*
* @param {string} selector
*/
export function moveIn(selector) {
$("#indicator").fadeOut("medium", () => {
$(selector).fadeIn("medium");
});
}
document.onreadystatechange = function () {
if (document.readyState !== "complete") {
document.getElementById("indicator").style.display = "block";
} else {
setTimeout(() => {
$("#indicator").fadeOut("medium", function () {
$("#include").load("pages/1.html");
$("main").fadeIn("medium");
});
}, 3000);
}
};