-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathclick.js
40 lines (36 loc) · 1.17 KB
/
click.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
38
39
40
/**
* JavaScriptQuick Reference:
*
* Access an element: document.getElementById("idName")
*
* Change the inner content of an element: element.innerHTML = "contents"
* @example document.getElementById("output").innerHTML = "foobar"
*
* Change the class of an element: element.className = "className"
* @example document.getElementById("output").className = "highlight"
*/
// const LANG = document.getElementsByClassName('changeLang')
// const OUTPUT = document.getElementById('output')
//Set variables
const LEARNMORE = document.getElementById('learnMore')
const MORE = document.getElementById('more')
let isHide = true
//Add event listeners
LLEFT.addEventListener('click', function() { changeLang() })
LRIGHT.addEventListener('click', function() { changeLang() })
LEARNMORE.addEventListener('click', function() {
if (isHide) {
isHide = false
MORE.style.display = 'block'
} else {
isHide = true
MORE.style.display = 'none'
}
})
//Set functions
function changeLang() {
if (LLEFT.innerHTML == 'English')
window.location.href = "Hall of Famous Vtubers.html"
else
window.location.href = "Hall of Famous Vtubers-CH.html"
}