0
votes

would anyone please suggest a custom jQuery scrollbar that is able to easily control the CSS position of a desired element (ex: left, top) instead of the usual scrolling of an element with overflow: hidden? Practically: I have a far & wide position: absolute ol listing inside an overflow: hidden container and I need to control it's visible area by setting CSS position through a custom scrollbar.

Many thanks for the tips!

2
"to easily control the CSS position of a desired element (ex: left, top) instead of the usual scrolling of an element with overflow: hidden". Instead? Usually you use the combination of both techniques. - edwin
Fair enough, I haven't really worked with custom scrollbars that much yet and wasn't sure on how they achieve the scrolling specifically. Any suggestions on a good base module to make this work that I can customize to achieve such behavior? - mystrdat

2 Answers

0
votes

see

jQuery.offset() and

jQuery.position() and

jQuery.animate()

also read HERE

Relative CSS

We’ve ported the functionality from the .animate() method, giving you the ability to update CSS properties using relative values. You can now prefix a CSS value with “+=” or “-=” to update the property relatively, in relation to the current value.

// Move an item 10px over
$("#item").css("left", "+=10px");
0
votes

If you really want a custom scrollbar, then you better use a ready-to-use plugin. Creating your own will probably take more time than you might think.

Here's a nice list of scrollbar plugins: