Sunday, June 2, 2024
 Popular · Latest · Hot · Upcoming
57
rated 0 times [  62] [ 5]  / answers: 1 / hits: 173036  / 12 Years ago, fri, march 30, 2012, 12:00:00

I'm wonder how the custom scrollbar on Facebook has been made.



Is it only css or some javascript as well?



If yes can i have an idea of what the code looks like?



This question is specific to Facebook scrollbar style and not how to simply have a custom scrollbar


More From » html

 Answers
30

This link should get you started. Long story short, a div that has been styled to look like a scrollbar is used to catch click-and-drag events. Wired up to these events are methods that scroll the contents of another div which is set to an arbitrary height and typically has a css rule of overflow:scroll (there are variants on the css rules but you get the idea).



I'm all about the learning experience -- but after you've learned how it works, I recommend using a library (of which there are many) to do it. It's one of those don't reinvent things...


[#86507] Thursday, March 29, 2012, 12 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
jarod

Total Points: 62
Total Questions: 111
Total Answers: 83

Location: Saint Vincent and the Grenadines
Member since Sat, Sep 11, 2021
3 Years ago
jarod questions
;