Commit 36758352 authored by lixy's avatar lixy

关于欣新

parent 8592591c
......@@ -157,27 +157,30 @@
methods: {
handleScroll: function () {
let scrollTop = window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop;
var menuTop = document.querySelector('#historyNav').offsetTop;
//滑动到指定位置菜单吸顶
if (scrollTop > menuTop-120) {
this.barFixed = true;
}
let top1 = document.querySelector('#history01').offsetTop;
let top2 = document.querySelector('#history02').offsetTop;
let top3 = document.querySelector('#history03').offsetTop;
let top4 = document.querySelector('#history04').offsetTop;
let path = $nuxt.$route.path;
if(path == '/aboutXx'){
var menuTop = document.querySelector('#historyNav').offsetTop;
//滑动到指定位置菜单吸顶
if (scrollTop > menuTop-120) {
this.barFixed = true;
}
let top1 = document.querySelector('#history01').offsetTop;
let top2 = document.querySelector('#history02').offsetTop;
let top3 = document.querySelector('#history03').offsetTop;
let top4 = document.querySelector('#history04').offsetTop;
if(scrollTop<201){
this.barFixed = false;
this.tabIndex = 0;
} else if(scrollTop >= 201 && scrollTop < top2-301){
this.tabIndex = 0;
} else if(scrollTop >= top2-301 && scrollTop < top3-301){
this.tabIndex = 1;
} else if(scrollTop >= top3-301 && scrollTop < top4-301){
this.tabIndex = 2;
} else if(scrollTop >= top4-301){
this.tabIndex = 3;
if(scrollTop<201){
this.barFixed = false;
this.tabIndex = 0;
} else if(scrollTop >= 201 && scrollTop < top2-301){
this.tabIndex = 0;
} else if(scrollTop >= top2-301 && scrollTop < top3-301){
this.tabIndex = 1;
} else if(scrollTop >= top3-301 && scrollTop < top4-301){
this.tabIndex = 2;
} else if(scrollTop >= top4-301){
this.tabIndex = 3;
}
}
},
/**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment