Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS Make fixed div slide down on hover

  • This topic is empty.
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #246738
    asiek
    Participant

    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?

    #246747
    Shikkediel
    Participant

    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:

    http://jsfiddle.net/s6mLJ/5861/

    #246749
    Shikkediel
    Participant

    Throttling the event, if one must, is quite a bit nicer…

    Like here

    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:

    Source

    #246750
    asiek
    Participant

    Wow thanks for the response! I truly appreciate your time and assistance!
    Nice !

    #246751
    Shikkediel
    Participant

    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.

Viewing 5 posts - 1 through 5 (of 5 total)
  • The forum ‘CSS’ is closed to new topics and replies.