style: change the header hidden way while scrolling
This commit is contained in:
parent
a5806ad20a
commit
1ae4979ae9
|
@ -64,6 +64,10 @@ $page-aside-width = $temp-width ? convert($temp-width):260px;
|
|||
box-sizing: border-box;
|
||||
transition();
|
||||
|
||||
&.hide {
|
||||
transform: translateY(-102%);
|
||||
}
|
||||
|
||||
.header-shrink & {
|
||||
height: $header-shrink-height;
|
||||
|
||||
|
@ -120,7 +124,6 @@ $page-aside-width = $temp-width ? convert($temp-width):260px;
|
|||
width: $main-content-width-mobile;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -33,7 +33,7 @@ function initTOC() {
|
|||
scrollTop: offset - 10,
|
||||
complete: function () {
|
||||
setTimeout(() => {
|
||||
KEEP.utils.pageTop_dom.style.transform = 'translateY(-100%)';
|
||||
KEEP.utils.pageTop_dom.classList.add('hide');
|
||||
}, 100)
|
||||
}
|
||||
});
|
||||
|
|
|
@ -38,9 +38,9 @@ KEEP.initUtils = () => {
|
|||
|
||||
// hide header handle
|
||||
if (scrollTop > this.prevScrollValue && scrollTop > this.innerHeight) {
|
||||
this.pageTop_dom.style.transform = 'translateY(-100%)';
|
||||
this.pageTop_dom.classList.add('hide');
|
||||
} else {
|
||||
this.pageTop_dom.style.transform = 'translateY(0)';
|
||||
this.pageTop_dom.classList.remove('hide');
|
||||
}
|
||||
this.prevScrollValue = scrollTop;
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue