You know, when looking at a page on the web, our indication of it’s length is the size of the scroll bar in our browser window (if it’s small, the page is long).
Sometimes, our assumption about the article’s length is wrong because while scrolling you see that most of the page is comments.
It’s quite difficult to find an general algorithm which can work on quite all websites, so I decided to focus on http://linuxfr.org, a kind of French Slashdot. It could have been Smashing Magazine too.
On LinuxFR.org, articles are composed of :
- The main article
- An optional second part
- Nested group of comments
It looks like:
Like my other Jetpack experiments, the MagicScrollbar is a just a proof of concept which lacks of polish. The user is able to see what the page contains in relative proportions: the article and the different groups of nested comments. Unfortunately, I can’t find an easy why to have access to the window document in Jetpack scripts, so I had to use a lot of tricks to get things done.
By the way, I have totally revamped my Jetpack laboratory and, as always, the code is still a mess.