SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Member
    Join Date
    Jul 2011
    Posts
    18
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Facebook nav bar!

    How does facebook manage to have all the content of the page scrollable except the top nav bar and chat?

  2. #2
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    24,331
    Mentioned
    463 Post(s)
    Tagged
    8 Thread(s)
    Basically with position: fixed:

    Code:
    #blueBar.fixed_elem {
        left: 0;
        top: 0;
    }
    
    #blueBar {
        background-color: #3B5998;
        min-width: 981px;
        width: 100%;
        z-index: 300;
    }
    
    .fixed_elem {
        position: fixed !important;
    }

  3. #3
    SitePoint Member
    Join Date
    Jul 2011
    Posts
    18
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Soo this means the any element with this will just stay on the browser window even if your scrolling down?

  4. #4
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    24,331
    Mentioned
    463 Post(s)
    Tagged
    8 Thread(s)
    Yes, that's the point of position: fixed. It doesn't work in some browsers, though, like IE6 and iPhone.

  5. #5
    SitePoint Member
    Join Date
    Jul 2011
    Posts
    18
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    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
  •