I'm creating a jQuery scrollbar which scrolls the content in a <div>. It's something like jQuery ScrollPane.
I've come to the point where I need to move the scroll button. My question is: what is the best way to do it without any UI plugin? So when the user clicks on the scroll button it can be moved vertically in its parent container with a mousedown event. How could I do that?
I developed a right nav dock style item with just plain javascript. Here is the link:
https://github.com/developerDoug/HtmlJavascriptDockInVS2010
Using a ui plugin would be best if you can convince your customer to do so. If not, what you'll need to focus on is hanling mousedown or something similar to that to be noticed that moving has began. The there methods to focus on are: mousedown, mousemove, mouseup.
For example, if on some div, you detect mousedown, you could call a function which basically would be your beginDrag, get x y coordinates, keep a reference to the start coordinates, attachEvent (if IE), addEventListener (for all other browsers).
ex:
Here's a starting point, hope that's what you're after: