-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscripts.js
29 lines (23 loc) · 865 Bytes
/
scripts.js
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
// Fart every 400 pixels scrolled
fartscroll();
var scroll = function test() {
var el = document.getElementById("infinite");
var newHeight = document.getElementById("infinite").offsetHeight + 10;
el.style.height = newHeight + "px";
console.log(el.style.height);
};
window.addEventListener("scroll", scroll, false);
window.addEventListener("load", function() {
var status = document.getElementById("status");
function updateOnlineStatus(event) {
var condition = navigator.onLine ? "online" : "offline";
status.className = condition;
status.innerHTML = condition.toUpperCase();
}
window.addEventListener("online", updateOnlineStatus);
window.addEventListener("offline", updateOnlineStatus);
});
if (navigator.onLine === false) {
alert("You seem to be offline.");
console.log("Is offline.");
}