-
Notifications
You must be signed in to change notification settings - Fork 0
/
t_nav.html
76 lines (57 loc) · 1.17 KB
/
t_nav.html
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
<!Doctype html>
<html>
<head>
<style type="text/css">
</style>
</head>
<body>
<ul>
<li class="flevel">
<a href="#">hi</a>
<div class="snav" style="display:none;">
hidden by default
</div>
</li>
<li class="flevel">
<a href="#">hi</a>
<div class="snav" style="display:none;">
hidden by default
</div>
</li>
</ul>
<script type="text/javascript">
window.onload=init;
function init()
{
document.getElementsByClassName("flevel")[0].onclick=function(){showad()};
console.log("inside function init");
}
function showad()
{
for(var i=0; i<2;i++)
{
console.log(i);
if(i==0){
if(document.getElementsByClassName("snav")[0].style.display=="block")
{
console.log("blocked so hide")
document.getElementsByClassName("snav")[0].style.display="none";
}else {
{
if(document.getElementsByClassName("snav")[0].style.display=="none")
{
console.log("blocked so hide")
document.getElementsByClassName("snav")[0].style.display="block";
}
}
}}
else {
document.getElementsByClassName("snav")[1].style.display=="none"
}
}
}
/*document.getElementsByClassName("snav")[0].style.display="block";*/
console.log("inside function showad");
</script>
</body>
</html>