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

解决分享的问题

上级 10c5ab84
...@@ -455,7 +455,7 @@ export default { ...@@ -455,7 +455,7 @@ export default {
scrollFun() { scrollFun() {
let scrollTop = let scrollTop =
document.body.scrollTop || document.documentElement.scrollTop; document.body.scrollTop || document.documentElement.scrollTop;
let h; let h = intorOffsetTop - 135
console.log(`scrollFun scrollTop intorOffsetTop cataOffsetTop`, scrollTop, intorOffsetTop, cataOffsetTop); console.log(`scrollFun scrollTop intorOffsetTop cataOffsetTop`, scrollTop, intorOffsetTop, cataOffsetTop);
// 显示头部导航 // 显示头部导航
...@@ -467,9 +467,12 @@ export default { ...@@ -467,9 +467,12 @@ export default {
this.bgColor = "none"; this.bgColor = "none";
} }
if(window.__isWeb) {
h = intorOffsetTop - 75;
}
// 如果滚动高度大于简介头部(并减去tab高度),则进行固定 // 如果滚动高度大于简介头部(并减去tab高度),则进行固定
// if(scrollTop > intorOffsetTop - 75) { if(scrollTop > h) {
if(scrollTop > intorOffsetTop - 135) {
this.fixedFlag = true; this.fixedFlag = true;
} else { } else {
this.fixedFlag = false; this.fixedFlag = false;
...@@ -481,16 +484,6 @@ export default { ...@@ -481,16 +484,6 @@ export default {
this.tabFlag = true; this.tabFlag = true;
} }
// this.fixedFlag = scrollTop > 300 ? true : false;
// 中华医学会项目
// if(this.project.cmeType == 2) {
// h = cataOffsetTop - 520;
// this.fixedFlag = scrollTop > 280 ? true : false;
// } else {
// h = cataOffsetTop - 600;
// this.fixedFlag = scrollTop > 420 ? true : false;
// }
// this.tabFlag = scrollTop > h ? false : true;
}, },
// 锚点到简介 // 锚点到简介
...@@ -507,7 +500,7 @@ export default { ...@@ -507,7 +500,7 @@ export default {
console.log(`jumpIntro cataOffsetTop intorOffsetTop`, cataOffsetTop, intorOffsetTop); console.log(`jumpIntro cataOffsetTop intorOffsetTop`, cataOffsetTop, intorOffsetTop);
let h; let h;
if (this.isWeb) { if (this.isWeb) {
h = intorOffsetTop - titleOffsetHeight; h = intorOffsetTop - 30 - titleOffsetHeight;
} else { } else {
h = intorOffsetTop - 85 - titleOffsetHeight; h = intorOffsetTop - 85 - titleOffsetHeight;
} }
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册