|
@@ -10,7 +10,7 @@
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="contrast-main">
|
|
<div class="contrast-main">
|
|
- <ul class="contrast-main-header flex-r-c" v-stickyed="stickyed">
|
|
|
|
|
|
+ <ul class="contrast-main-header flex-r-c" ref="stickyHeader" v-stickyed="stickyed">
|
|
<li class="top-title modify-left">功能/产品</li>
|
|
<li class="top-title modify-left">功能/产品</li>
|
|
<li class="top-title modify-center gray">免费订阅</li>
|
|
<li class="top-title modify-center gray">免费订阅</li>
|
|
<li class="top-title modify-right flex-r-c center">
|
|
<li class="top-title modify-right flex-r-c center">
|
|
@@ -113,12 +113,14 @@ export default {
|
|
return {
|
|
return {
|
|
stickyed: {
|
|
stickyed: {
|
|
className: ['contrast-fixed'],
|
|
className: ['contrast-fixed'],
|
|
- startFixedTop: 1000 // 从高度为startFixedTop处开始置顶
|
|
|
|
|
|
+ startFixedTop: 1000, // 从高度为startFixedTop处开始置顶
|
|
|
|
+ forbid: false
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
},
|
|
mounted () {
|
|
mounted () {
|
|
setTimeout(this.calcStickyNav, 100)
|
|
setTimeout(this.calcStickyNav, 100)
|
|
|
|
+ this.$refs.stickyHeader.windowScrollStickyEventCallback = this.stickyCallback
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
calcStickyNav () {
|
|
calcStickyNav () {
|
|
@@ -126,6 +128,14 @@ export default {
|
|
if (offset) {
|
|
if (offset) {
|
|
this.stickyed.startFixedTop = offset.top - 70
|
|
this.stickyed.startFixedTop = offset.top - 70
|
|
}
|
|
}
|
|
|
|
+ },
|
|
|
|
+ stickyCallback () {
|
|
|
|
+ // 表格顶部固定
|
|
|
|
+ const tableDom = $(this.$refs.main)
|
|
|
|
+ const tableHeaderChangeDom = $(this.$refs.stickyHeader)
|
|
|
|
+ const tableMaxHeight = tableDom.height() + this.stickyed.startFixedTop - tableHeaderChangeDom.height()
|
|
|
|
+ const show = $(window).scrollTop() > this.stickyed.startFixedTop && $(window).scrollTop() < tableMaxHeight
|
|
|
|
+ this.stickyed.forbid = !show
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -244,6 +254,7 @@ export default {
|
|
display: none;
|
|
display: none;
|
|
padding: 0 30px;
|
|
padding: 0 30px;
|
|
height: 68px;
|
|
height: 68px;
|
|
|
|
+ flex-wrap: nowrap;
|
|
.modify-left {
|
|
.modify-left {
|
|
width: 468px;
|
|
width: 468px;
|
|
height: 100%;
|
|
height: 100%;
|