Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8331977
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T02:35:00+00:00 2026-06-09T02:35:00+00:00

Google has an excellent blog that has a fairly neat header – as you

  • 0

Google has an excellent blog that has a fairly neat header – as you scroll down the gray bar in the header moves up, until it stops when it is at the top of the screen (it also does some fancy z-index tricks but I’m not interested in those).

While I’m aware of CSS’s position:fixed, what Google seems to have done is combine position:fixed and position:relative based on the current position of the vertical scroll bar. I guess I would be able to duplicate this behaviour using scroll events, fancy math, and some messy scripted jQuery/CSS, but I’m wondering if there is a cleaner, elegant, perhaps third-party solution to do this, as opposed to reinventing the wheel which may or may not work the first time.

What is the cleanest way to get a Google Blog-style header in my web page, preferably using CSS2 and jQuery for x-browser compatibility?

Edit – Bonus points if there’s a way that doesn’t require specifying heights to elements above the element to be scrolled.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T02:35:02+00:00Added an answer on June 9, 2026 at 2:35 am

    Duplicating their css (more or less) with the placeholder, and then using some simple javascript results in a pretty smooth effect.

    See http://jsfiddle.net/n9yPH/31/

    The Jquery used is this:

    $(function()
       {
           var start = $("#second").offset().top;
           $(window).scroll(function(e){
               var top = $("body").scrollTop();
               if (start-top >=0) $("#second").css("top",(start-top)+"px");
               else $("#second").css("top","0px");
           });
       });​
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

It is known that google has best searching & indexing algorithm. The also have
I was wondering if it is possible that Google has a feature to view
Google has failed me and Netbeans 7 is fairly new so I can't find
Google has a unit conversion feature that takes a human readable string such as:
Recently, Google has created a new Search API that you can integrate into your
Google has indexed certain pages in my website that I wouldn't like users to
Google has an email auditing feature that will allow a google apps admin to
google has been unkind... I recently pulled down boost 1.50, and am trying to
I have a game in the Google Play Store that has an option to
Since Google has announced that it is deprecating Google Maps for Flash , I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.