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