MyBB Community Forums
Hide header on scroll, show on scroll up - Printable Version

+- MyBB Community Forums (https://community.mybb.com)
+-- Forum: 1.8 Support (https://community.mybb.com/forum-175.html)
+--- Forum: General Support (https://community.mybb.com/forum-176.html)
+--- Thread: Hide header on scroll, show on scroll up (/thread-227663.html)



Hide header on scroll, show on scroll up - Eldenroot - 2020-05-07

Hi folks!

I have found this tutorial:
https://medium.com/@mariusc23/hide-header-on-scroll-down-show-on-scroll-up-67bbaae9a78c

with a working example:
http://jsfiddle.net/mariusc23/s6mLJ/31/

Anyway I have an issue with applying to MyBB, is there anybody who can help me? It is sufficient for MyBB default theme. Thank you!


RE: Hide header on scroll, show on scroll up - [ExiTuS] - 2020-05-08

Hi,

It bases on the <header> tag. For MyBB standard theme it needs to be adopted to the element id "#header".
So you need to change the JS code to something like this.
getElementByID("header").removeClass(...).addClass(...)

BTW. This simple mod is great but with a loss on flexibility due to fixed position and pixel-based dimensions/padding.

Good luck!

[ExiTuS]