Reputation: 6906
For example...the new facebook activity stream on the right. Or on okay cupid (the message/rating dialogue).
How does this work exactly. Can someone point me to a tutorial or explanation?
Thanks!
Upvotes: 0
Views: 176
Reputation: 354
Add some Javascript to set position: fixed; top: 0px; when $(window).scrollTop() reaches the $("#element_id").offset().top.
Google does a similar thing with their new gmail look
Upvotes: 2
Reputation: 86892
There are many ways to do this but here is one using CSS only
<div style="position:fixed; left:0; top:0; height:100px; width:100%">Stuck to Top</div>
Here is a fiddle
Upvotes: 4