NanoScroller.js - An easy-to-use jQuery scrollbar that looks like Lion's.
jamesflorentino.com
jamesflorentino.com
The best technical approach is to make the scrollable element naturally scrollable with overflow: auto, and then put it inside a viewport element (overflow: hidden) narrow enough to cut off the scrollbar (there are plugins that can help you figure out exactly how wide the host's OS's scrollbars are).
Then, you're free to listen for scroll events and overlay your own custom scroller UI.
I agree that it is best to let the browser handle the scrolling mechanics. Then you simply hide the original scrollbar by having an embedded div hold the content with a width thats about 40px or so bigger than the outer, fixed width div ( and overflow: scroll-y ).
Seems to do the same job whilst respecting lion scroll direction (Haven't tested with standard scrolling so there's a chance they could have just imitated reverse scrolling)
Fuck the design if it's unusable.
Native widgets with reliable behavior and useability be damned; it looks pretty and thats what we've always really wanted.
You're the website, you deliver me content, I decide what to do with it. Don't take really long ways around to force me to do things your way, use semantic HTML and CSS, use the default scroll bars, let me pick a user-agent that makes scroll-bars the way I want. I don't want to use OSX Lion scroll bars because I think mac's are lame, but now I have no choice.
Section "Violating Design Conventions".
This is exactly why you shouldn't implement/use other scrollbars and similar things which change the behaviour of standard design practices.
1) scrollbar disappears on drag when the mouse moves out of the container. To fix you need to have a flag when the scrollbar is dragging and not call fadeout when true.
2) convenient UI feature: scrollbar can appear on hover, then disappear if user hasn't moved mouse, and reappear on mousemove. This is done in Facebook for example. This is accomplished by setting and clearing timeouts.
(also, the bot left container for the scrollbar doesn't have a rounded corner)
otherwise great job!
Edit: as per slig's comment, a lot of tools in google's latest design refresh are using terrible scroll bars, too.
Many web browsers already have this functionality (sort of) with middle-click.
Forcing the user to navigate to some tiny on-screen affordance which takes up screen real estate is a terrible design (except in the special case where the scroll bar is at the extreme edge of the screen).
Mobile web browsers seem to get this right. Touch the element you want to scroll & drag it; an overlay pops up to show your relative location. Intuitive, easy, and doesn't take up screen real estate.
Scroll wheels (especially Kensington's beautiful "Orbit" scroll rings on their trackballs) are pretty close to the mark too.
Now for all people that cry about cross browser difference, you ought to put you energy at criticizing developers that create browsers that are not compatible with w3c standards.
I for one do not want to see same boring scrollbars until I die. Let's be realistic, browser scrollbars haven't changed in the past 20 years (except the option to change colors and that was wow back in the day). It's about time that they do.
Oh and, IE should be banned forever :)
Edit: Just updated to 16.0.912.59 beta-m (newest on this channel), still working in reverse. OS: XP.