Results 1 to 3 of 3

Thread: Static menu/navigation that scrolls with you

  1. #1
    Join Date
    Jul 2011
    Posts
    40
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default Static menu/navigation that scrolls with you

    I'm not sure if this is css or javascript. I feel as if this could just be z-index or something but just wanted to ask to make sure.

    How would I make a menu/navigation that follows as you scroll not a floating menu but for example something like these:

    Example 1
    Example 2
    Example 3

    Notice how the menu just moves with the scrolling(as if following you). I want that but I am not sure how I would do it.

  2. #2
    Join Date
    May 2012
    Location
    Hitchhiking the Galaxy
    Posts
    1,013
    Thanks
    46
    Thanked 139 Times in 139 Posts
    Blog Entries
    1

    Default

    Okey doke mandnhate, this is actually a fairly easy CSS problem. So the reason it follows you is because of the part in the CSS saying:
    Code:
    position: fixed;
    Which basically means that the piece has a fixed position on the page no matter where you scroll. So for example if you had a top bar with an ID of top bar, it'd look like this.
    Code:
    #topbar {
    position: fixed;
    top: 0px;
    }
    bernie

  3. #3
    Join Date
    Jul 2011
    Posts
    40
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    I think it's actually javascript & css because I saw someone actually do something similar with javascript where the navigation is static and becomes fixed when you scroll from a javascript code. I wonder how you make it stop on a specific portion of

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •