提交 c70a1adb 编写于 作者: guangjun.yang's avatar guangjun.yang

代码整理等

上级 f9bd5304
此差异已折叠。
此差异已折叠。
...@@ -456,8 +456,6 @@ export default { ...@@ -456,8 +456,6 @@ export default {
let scrollTop = let scrollTop =
document.body.scrollTop || document.documentElement.scrollTop; document.body.scrollTop || document.documentElement.scrollTop;
let h = intorOffsetTop - 135 let h = intorOffsetTop - 135
console.log(`scrollFun scrollTop intorOffsetTop cataOffsetTop`, scrollTop, intorOffsetTop, cataOffsetTop);
// 显示头部导航 // 显示头部导航
if (scrollTop > 20) { if (scrollTop > 20) {
this.isBlack = true; this.isBlack = true;
...@@ -479,6 +477,7 @@ export default { ...@@ -479,6 +477,7 @@ export default {
} else { } else {
this.fixedFlag = false; this.fixedFlag = false;
} }
// 如果滚动高度大于 // 如果滚动高度大于
if(scrollTop > cataOffsetTop - 600) { if(scrollTop > cataOffsetTop - 600) {
this.tabFlag = false; this.tabFlag = false;
...@@ -490,21 +489,15 @@ export default { ...@@ -490,21 +489,15 @@ export default {
// 锚点到简介 // 锚点到简介
jumpIntro() { jumpIntro() {
// this.tabFlag = true;
// this.fixedFlag = true;
if(!this.tabFlag) { if(!this.tabFlag) {
this.tabFlag = true; this.tabFlag = true;
} }
if(!this.fixedFlag) { if(!this.fixedFlag) {
this.fixedFlag = true; this.fixedFlag = true;
} }
console.log(`jumpIntro cataOffsetTop intorOffsetTop`, cataOffsetTop, intorOffsetTop);
let h; let h;
if (this.isWeb) { if (this.isWeb) {
h = intorOffsetTop - 30 - titleOffsetHeight; h = intorOffsetTop - 30 - titleOffsetHeight;
// } else if(window.__isIOS){
// h = intorOffsetTop - 35 - titleOffsetHeight;
} else { } else {
h = intorOffsetTop - 85 - titleOffsetHeight; h = intorOffsetTop - 85 - titleOffsetHeight;
} }
...@@ -524,12 +517,10 @@ export default { ...@@ -524,12 +517,10 @@ export default {
if(!this.fixedFlag) { if(!this.fixedFlag) {
this.fixedFlag = true; this.fixedFlag = true;
} }
console.log(`jumpCatalogue cataOffsetTop intorOffsetTop`, cataOffsetTop, intorOffsetTop);
let h; let h;
if (this.isWeb) { if (this.isWeb) {
h = cataOffsetTop - titleOffsetHeight; h = cataOffsetTop - titleOffsetHeight;
} else { } else {
// h = cataOffsetTop - 75 - titleOffsetHeight;
h = cataOffsetTop - 100; h = cataOffsetTop - 100;
} }
window.scrollTo(0, h); window.scrollTo(0, h);
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册