-
Notifications
You must be signed in to change notification settings - Fork 0
/
myjs.js
37 lines (27 loc) · 825 Bytes
/
myjs.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
30
31
32
33
34
35
36
37
/* A freenode #web production in collaboration with Buck */
document.addEventListener('DOMContentLoaded', (event) => {
/**
* Taking care of the folding menus first
*/
const navlis = document.querySelectorAll('#main_navigation li')
navlis.forEach( navli =>
navli.addEventListener( 'click', e => {
const uls = navli.querySelector('ul')
if( uls) {
console.log( e)
navli.classList.toggle( 'closed')
navli.classList.toggle( 'open')
}
e.stopImmediatePropagation();
})
)
/**
* And then the faq page
*/
const faqs = document.querySelectorAll( 'ol.faq li')
faqs.forEach( faq => {
const a = faq.querySelector( 'a')
const span = faq.querySelector( 'span')
a.addEventListener( 'click', e => span.classList.toggle( 'hidden'))
})
})