I have this javascript code that scrolls a div depending on the mouse position.
Ive got the code working, the problem is its a bit jittery. I was wondering if anybody could give me advice on how to optimise it so it runs smoothly!
To view the code please visit my jsfiddle:
I realised i was going WELL too far with this, and the solution was easy.
You calculate the new scroll position based on the EXACT mouse Position… Code Follows: