Commit 36758352 authored by lixy's avatar lixy

关于欣新

parent 8592591c
...@@ -157,27 +157,30 @@ ...@@ -157,27 +157,30 @@
methods: { methods: {
handleScroll: function () { handleScroll: function () {
let scrollTop = window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop; let scrollTop = window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop;
var menuTop = document.querySelector('#historyNav').offsetTop; let path = $nuxt.$route.path;
//滑动到指定位置菜单吸顶 if(path == '/aboutXx'){
if (scrollTop > menuTop-120) { var menuTop = document.querySelector('#historyNav').offsetTop;
this.barFixed = true; //滑动到指定位置菜单吸顶
} if (scrollTop > menuTop-120) {
let top1 = document.querySelector('#history01').offsetTop; this.barFixed = true;
let top2 = document.querySelector('#history02').offsetTop; }
let top3 = document.querySelector('#history03').offsetTop; let top1 = document.querySelector('#history01').offsetTop;
let top4 = document.querySelector('#history04').offsetTop; let top2 = document.querySelector('#history02').offsetTop;
let top3 = document.querySelector('#history03').offsetTop;
let top4 = document.querySelector('#history04').offsetTop;
if(scrollTop<201){ if(scrollTop<201){
this.barFixed = false; this.barFixed = false;
this.tabIndex = 0; this.tabIndex = 0;
} else if(scrollTop >= 201 && scrollTop < top2-301){ } else if(scrollTop >= 201 && scrollTop < top2-301){
this.tabIndex = 0; this.tabIndex = 0;
} else if(scrollTop >= top2-301 && scrollTop < top3-301){ } else if(scrollTop >= top2-301 && scrollTop < top3-301){
this.tabIndex = 1; this.tabIndex = 1;
} else if(scrollTop >= top3-301 && scrollTop < top4-301){ } else if(scrollTop >= top3-301 && scrollTop < top4-301){
this.tabIndex = 2; this.tabIndex = 2;
} else if(scrollTop >= top4-301){ } else if(scrollTop >= top4-301){
this.tabIndex = 3; 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