If you go to an article on The Economist website. For example:
When you scroll down the page past a certain point (either with the PAGEDOWN button or by incrementally scrolling with the DOWNARROW key), a red sticky header appears.
Is that jQuery?
How is that implemented?
The content, while added via JavaScript is just position: fixed.
The Economist uses Apture, a service which includes the sticky header and a few other features on the page. (The header has the ID "aptureD", so I started Googling.) If all you want is that exact header, you can just use their service.
You can use the Apture or make a custom sticky header. Look at example.
来源:https://stackoverflow.com/questions/4360816/how-does-economist-com-implement-their-sticky-header-jquery