jlizarraga
02-04-2009, 11:47 PM
Hi all,
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:
http://www.carmax.com/enUS/compare-cars/default.html?N=4294966911&SL=5176436+5610175+5369316+5483379&D=90&zip=92102&No=0&Ep=Homepage%20Make&Rp=R&Vp=C&PP=20&sV=List&CD=14+240+190+8+9&Q=66cf19e1-cb94-4450-ba4d-463523a38047&ACLc=5176436+5610175+5369316+5483379+5369171+5547657
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.
Thanks!
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:
http://www.carmax.com/enUS/compare-cars/default.html?N=4294966911&SL=5176436+5610175+5369316+5483379&D=90&zip=92102&No=0&Ep=Homepage%20Make&Rp=R&Vp=C&PP=20&sV=List&CD=14+240+190+8+9&Q=66cf19e1-cb94-4450-ba4d-463523a38047&ACLc=5176436+5610175+5369316+5483379+5369171+5547657
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.
Thanks!