-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
49 lines (32 loc) · 856 Bytes
/
index.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
41
42
43
44
45
46
47
48
49
//下拉菜单
window.onload=function(){
var dropdown=document.getElementById("dropdown");
// console.log(dropdown);
var dropdownList=dropdown.getElementsByTagName("li");
// console.log(dropdownList)
for(var i=0; i<dropdownList.length; i++){
// console.log(i)
if(i==1){
continue;
}
dropdownList[i].onmouseover=function(){
this.classList.add('show');
}
dropdownList[i].onmouseout=function(){
this.classList.remove('show');
}
}
// 分类菜单
var navLi=document.getElementsByClassName("nav-li");
// console.log(navLi)
for(var j=0;j<navLi;j++){
// console.log(j)
navLi[j].onmouseover=function(){
this.classList.add('show');
console.log(navLi[j])
}
navLi[j].onmouseout=function(){
this.classList.remove('show');
}
}
}