Skip to content

Commit

Permalink
fix header visible or hide in one requestAnimationFrame
Browse files Browse the repository at this point in the history
  • Loading branch information
ToffeeLu authored and afc163 committed Dec 3, 2018
1 parent b6267b5 commit 51fc795
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/layouts/Header.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,12 +99,12 @@ class HeaderView extends PureComponent {
visible: true,
});
}
if (scrollTop > 300 && visible) {
else if (scrollTop > 300 && visible) {
this.setState({
visible: false,
});
}
if (scrollTop < 300 && !visible) {
else if (scrollTop < 300 && !visible) {
this.setState({
visible: true,
});
Expand Down

0 comments on commit 51fc795

Please sign in to comment.