Hang on - don’t shoot me yet! Why am I talking about something so 1999 as a Javascript scroller?
At work the other day I was working on a UI project for an internal system of a fairly large client. This UI required some navigation, but the space provided did not show the full navigation. The UI was designed this way (I did not design it), and I had to come up with a quick mockup of actual functionality so the client could see how things would work.
I went on the hunt for a javascript that would let me use CSS to hide the overflow from the navigation area, and use JS to scroll the area up and down. The best I found was this Absolutely Positioned Scrollable Area, which is the SAME exact script I had used back in 2000 to do something similar.
Well - I didn’t like the looks of the script at all, with it’s browser checking and whatnot, so I kept looking until I came across Chris Heilmann’s DOMnews script. Not exactly what I was looking for, but it had potential.
Now, let me say that Chris is Javascript guru and certainly much more skilled than I when it comes to the ways of writing good code. I use his Unobtrusive Javascript tutorial quite often.
Anyway, I grabbed his script and started hacking away at it until I got more or less what I needed. Under normal conditions, I probably wouldn’t share this but because there seems to be a lack of anything like this that is at all up to date, so without further ado:
It should be pretty easy to figure out what’s going on, and modify for your own needs. Hopefully someone finds it useful - let me know in the comments what you think.