On this cnet.com page, how do they program the "social sharing" div (you'll see it over on the left side), so that it scrolls until it reaches the top of the viewport, then its fixed until it reaches the footer?
Any ideas?
| SitePoint Sponsor |
On this cnet.com page, how do they program the "social sharing" div (you'll see it over on the left side), so that it scrolls until it reaches the top of the viewport, then its fixed until it reaches the footer?
Any ideas?


It's done with JavaScript, but there are so many dang scripts on that page I can't see which one it is. I'll move this to the JS forum so someone with better eyes can help you.


It's the code in the news.tron..post.compressed.js file, of which a part of the mootools code contains:
Code javascript:var ShareBar = new Class({ Extends: Fixation, Implements: [Options, Events], options: { defaultView: "side", enableToggle: true, barId: "shareBar", views: { ...
If you're more used to jQuery, there's the floater plugin which does the job well too.
Programming Group Advisor
Reference: JavaScript, Quirksmode Validate: HTML Validation, JSLint
Car is to Carpet as Java is to JavaScript
Thanks for the help guys. I was hoping they were somehow doing it with CSS3
Still holding out hope that Paul O might reach into his bag o tricks for an unscripted, CSS solution, but I kinda doubt there is one to be had.
Bookmarks