-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmyscript.js
More file actions
79 lines (58 loc) · 1.51 KB
/
Copy pathmyscript.js
File metadata and controls
79 lines (58 loc) · 1.51 KB
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
window.onload=(function load(){
hideInfo();
var games=document.querySelectorAll('.drop li');
for(var i=0;i<games.length;i++){
games[i].addEventListener("click",showInfo);
}
})();
function hideInfo(){
document.getElementById("RPG").style.display='none';
document.getElementById("FPS").style.display='none';
document.getElementById("Racing").style.display='none';
document.getElementById("Free to play").style.display='none';
}
//Global variable
var flag=false;
//
function showGames(){
var games=document.querySelectorAll('.drop li');
if(flag==false){
hideInfo();
for (var i = 0; i < games.length; i++) {
games[i].style.display='block';
}
flag=true;
}
else{
for (var i = 0; i < games.length; i++) {
games[i].style.display='none';
}
flag=false;
}
}
function showInfo(){
hideInfo();
var text = this.children[0].innerText;
if(text=="RPG"){
document.getElementById("RPG").style.display='block';
showGames();
}
else if(text=="FPS"){
document.getElementById("FPS").style.display='block';
showGames();
}
else if(text=="Racing"){
document.getElementById("Racing").style.display='block';
showGames();
}
else if(text=="Free to play"){
document.getElementById("Free to play").style.display='block';
showGames();
}
}
function closeCurrentTab(){
var con=confirm("Are you sure, you want to cancel signing up?");
if(con==true){
window.location.href="index.html";
}
}