6 comments

  • Jonathan SvärdénJonathan Svärdén, over 7 years ago

    Wait a minute. Even without any JavaScript whatsoever the header would disappear out of view when the page is scrolled down, and reappear when scrolled back up. Now we think we need a couple hundred lines of JS to do it? Everything is so backwards in the web industry these days.

    No disrespect to the author.

    1 point
    • Alex PascalAlex Pascal, over 7 years ago

      It appears even when you're not at the top of the page. Scroll all the way down then scroll up just a bit and it should pop up.

      1 point
    • Ryan GloverRyan Glover, over 7 years ago

      A decent bit of unnecessary bloat for the average site, though, could be nice in certain contexts (e.g. long form pages like documentation).

      0 points
    • Nick WilliamsNick Williams, over 7 years ago

      No disrespect taken! However, I would like to respond to some of the things you've said...

      Firstly, I think a couple of hundred lines of JS is negligible, being as it only weighs 1.2kb minified & gzipped. When the average amount of JS per page is > 250kb [0], this is a drop in the sea!

      As for the effect, it is subtly different from the static (static in css terms) header you describe. I think of it as a halfway house between a fixed header and a static header. You get the benefits of static header (maximising vertical screen space) while keeping the benefits of a fixed header (primary navigation always close to hand).

      Does it work well in all circumstances? Certainly not! Does it work well in some circumstances? Definitely! As with most UX patterns, blindly applying them is foolish. Instead decide whether it fits your use-cases, and go from there.

      [0] http://httparchive.org/trends.php#bytesJS&reqJS

      1 point
      • Jonathan SvärdénJonathan Svärdén, over 7 years ago

        It has its uses, you're right about that. Lately though, I've been looking more closely at site performance and load speed, and you need to really weigh the pros and cons of anything you add to the page, no matter how light it may look.

        Still, kudos on this project. I wish my code was half as readable as yours.

        0 points
  • Bruno Daniel, over 7 years ago (edited over 7 years ago )

    Recent relevant discussion on the pattern: news.layervault.com/stories/24202-the-scroll-up-bar-

    Discussion on HN going on right now: news.ycombinator.com/item?id=7805489

    0 points