-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
32 lines (28 loc) · 855 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
var tabs=document.getElementById("tabs").getElementsByTagName("li");
var lists=document.getElementById("lists").getElementsByTagName("ul");
//console.log(tabs);
for(var i=0;i<tabs.length;i++){
tabs[i].onclick=showlist;
};
function showlist(){
for(var i=0;i<tabs.length;i++){
if(tabs[i]==this){
tabs[i].className="active";
lists[i].className="clearfix active";
}else
{
tabs[i].className="";
lists[i].className="clearfix";
};
};
};
var seckillNav=document.getElementById("seckillNav");
window.onscroll=function(){
var scrollTOP=document.documentElement.scrollTop || window.pageYOffset || document.body.scrollTop;
// console.log(scrollTOP);
if(scrollTOP>=260){
seckillNav.className="seckill-nav seckill-navfixed";
}else{
seckillNav.className="seckill-nav";
};
};