- This topic is empty.
Viewing 5 posts - 1 through 5 (of 5 total)
Viewing 5 posts - 1 through 5 (of 5 total)
- The forum ‘CSS’ is closed to new topics and replies.
The forums ran from 2008-2020 and are now closed and viewable here as an archive.
Hello.
I’ve been following this tutorial:
https://medium.com/@mariusc23/hide-header-on-scroll-down-show-on-scroll-up-67bbaae9a78c#.dhqq2lq25
The JsFiddle included is:
http://jsfiddle.net/mariusc23/s6mLJ/31/
In the example the header slides down when the viewer scrolls up…
But I’m wondering how I can allow the viewer to hover over the top part of the browser and have the header slide down even if they haven’t scrolled up yet…
Please help?
To be honest… that’s not the greatest script. It’s going on the urban myth that scroll
fires with every pixel. And letting a timeout run indefinitely. Brrr, it hurts my code aesthetic nerve.
:-)
Anywho, here’s an idea:
Throttling the event, if one must, is quite a bit nicer…
Edit – well, the real thing anyway (the timeout could also be considered as such)…
That’ll only run when the user scrolls instead of in the background continuously, just in case he happens to.
Extracted from Ben Alman’s plugin:
Wow thanks for the response! I truly appreciate your time and assistance!
Nice !
Glad to help. :-)
You would likely be fine without any throttling too. Only the combination of an old computer, a large script and someone dragging the scrollbar might practically lead to trouble. But that mini plugin won’t hurt either under these circumstances.