-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path3_yinchang.html
122 lines (112 loc) · 3.35 KB
/
3_yinchang.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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<!--权重值 id100 class 10 tag 1-->
<title>隐藏菜单</title>
<style>
*{
padding: 0;
margin: 0;
}
#mnu .top-1{
list-style: none;
float: left;
background: grey;
margin-right: 5px;
width: 100px;
height: 30px;
}
#mnu, a{
text-decoration:none;
display: block;
line-height: 30px;
text-align: center;
}
#mnu li:hover{
background-color: olivedrab;
}
#mnu .zi {
display: none;
}
#mnu .zi li {
list-style: none;
border-bottom: 2px rosybrown dashed;
text-align: left;
background: gold;
}
#mnu .zi a
{
display: block;
text-align: left;
text-indent: 10px;
}
#mnu .zi a:hover{
background-color: aqua;
}
</style>
</head>
<body>
<ul id="mnu">
<li class="top-1">
<a href="#">lin1</a>
<ul class="zi">
<li><a href="#">a</a></li>
<li><a href="#">b</a></li>
<li><a href="#">c</a></li>
</ul>
</li>
<li class="top-1">
<a href="#">line2</a>
<ul class="zi">
<li><a href="#">a</a></li>
<li><a href="#">c</a></li>
<li><a href="#">b</a></li>
</ul>
</li>
<li class="top-1">
<a href="#">line3</a>
<ul class="zi">
<li><a href="#">c</a></li>
<li><a href="#">b</a></li>
<li><a href="#">a</a></li>
</ul>
</li>
<!--js中的变量包括(字母数字 下划线 $ &&)-->
</ul>
<!--<script>-->
<!--var oUl=document.getElementById("mnu");-->
<!--var aLi = oUl.getElementsByTagName('li');-->
<!--//alert(aLi.length);-->
<!--//12li 3class='top-1'-->
<!--for(var i=0;i<aLi.length;i++)-->
<!--{-->
<!--if (aLi[i].className == 'top-1')-->
<!--{-->
<!--aLi[i].onmouseover= function()-->
<!--{-->
<!--var oSub=this.getElementsByTagName('ul')[0];-->
<!--oSub.style.display='block';-->
<!--}-->
<!--aLi[i].onmouseout= function()-->
<!--{-->
<!--var oSub=this.getElementsByTagName('ul')[0];-->
<!--oSub.style.display='none';-->
<!--}-->
<!--}-->
<!--}-->
<!--</script>-->
<script>
var oUl=document.getElementById("mnu");
var aLi=oUl.getElementsByTagName("li");
for(var i=0;i<aLi.length;i++){
if(aLi[i].className=='top-1'){
aLi[i].onmouseover=function () {
var oSu=this.getElementsByTagName('ul')[0];
oSu.style.display='block';
}
}
}
</script>
</body>
</html>