-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathscript.js
25 lines (24 loc) · 842 Bytes
/
script.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
var acc = document.getElementsByClassName("accordion");
var i;
for (i = 0; i < acc.length; i++) {
acc[i].onclick = function () {
this.classList.toggle("active");
var panel = this.nextElementSibling;
if (panel.style.maxHeight) {
panel.style.maxHeight = null;
} else {
panel.style.maxHeight = panel.scrollHeight + "px";
}
};
}
if ('serviceWorker' in navigator) {
window.addEventListener('load', () => {
navigator.serviceWorker.register('./serviceWorker.js').then(reg => {
// Registration was successful
// console.log('ServiceWorker registration successful with scope: ', reg.scope);
}, err => {
// registration failed :(
// console.log('ServiceWorker registration failed: ', err);
});
});
}