I have a set of droppable li elements that accepts a draggable icon. The list of items is in a scrollable div element. I put together a simple example here: http://www.nerdydork.com/demos/dragscroll/
I'm wondering if there is a way to autoscroll the list of elements when you are dragging the draggable element. For example, let's say you are somewhere in the middle, like http://www.nerdydork.com/demos/dragscroll/#j . As you approach the top of the div, it will start scrolling up, as you approach the bottom of the div it will start scrolling down.
Anyone know how to accomplish this with jQuery?
UPDATE
I'm getting closer. I created fixed div on the upper & lower portions of the container div. When hovering over it starts an autoscroll using http://plugins.jquery.com/project/aautoscroll
Now the problem is when I hover over the lower area, it messes up my draggable on the letters. It only seems to be a problem with the lower autoscroll area though.
To see the bug I'm talking about, watch this short video: http://screencast.com/t/JBFWzhPzGfz
Notice how when it autoscrolls down, the hover is NOT over the right letter. Toward the end of the video you can see that if you hover over the left margin of the list, then it somehow resets and seems to work again.
Setting the "refreshPositions: true" option for the draggable will cause jQuery to recalculate the offsets on every mouse event. That should fix your problem.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With