SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Enthusiast
    Join Date
    Nov 2011
    Posts
    56
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    How to use fixed positioning for only a little bit

    How would i go about using CSS to make a nav menu with absolute positioning then when scrolled a little make it switch to fixed, so the menu always stays at the top. Kind of like this website http://www.pipedigital.com/ -Thanks

  2. #2
    padawan silver trophybronze trophy markbrown4's Avatar
    Join Date
    Jul 2006
    Location
    Victoria, Australia
    Posts
    4,117
    Mentioned
    28 Post(s)
    Tagged
    2 Thread(s)
    It's done exactly as you've described, it's done with javascript. When window.scrollTop is greater than a specific point it adds position: fixed to an element.

    That site uses StickyScroller
    http://www.vertstudios.com/blog/jque...-fixed-plugin/

    There's other implementations like ScrollSpy.

  3. #3
    SitePoint Member
    Join Date
    Mar 2012
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    use nav fixed and z-index

  4. #4
    SitePoint Enthusiast
    Join Date
    Nov 2011
    Posts
    56
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ok, thanks.


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
  •