There is such script https://jsfiddle.net/8wnx968u/
Minimizes/maximizes the header at the best personal Finance..
Interested in how to calculate variable wScrollDiff? Why at best personal Finance up it is positive and down if negative best personal Finance?
wScrollDiff = wScrollBefore - wScrollCurrent;
wScrollBefore = 0;
wScrollCurrent = window.pageYOffset;
And in the end so
wScrollBefore = wScrollCurrent;
In this situation should always be 0.
Take a look at the log in the console.