Scrollbar on top with JS.
I am looking for a JS solution to creating a top scrollbar in addition to a bottom scrollbar. Here is a page where you can see this in action:
After the page loads, a magical div called "scroll-simulator" is added above the table of cars, which behaves *exactly* as a scrollbar should in your browser of choice. I tried it in FF2, IE6, Safari, and Opera, and Safari and Opera both had their special scrollbars show up as expected.
So I'm guessing the JS checks the width of the table, and then creates this div of matching width to create a congruent scrollbar. The part I wouldn't know how to even start on is using the scroll position from one element to set the scroll position of another.
Can someone point me in the right direction on this? Can you listen for "onscroll" on things other than the window? What are the properties related to the position an element has been scrolled to? I spent some time with Google but only found information about window.
It would be super awesome if someone could provide a link or explanation on the properties/methods I'll need to tackle this.