Hi! I've a DIV which contains an IMG. This image is wider than the div, so a scrollbar appears on page. What I want to do, is click on the div(image) and move the mouse, and scroll the div as I move the mouse.
I've tried using event ondrag in the div, and inside I can move the scroll with scrollTop and/or scrollLeft. My problem is that I haven't been able to make a good algorithm.
I've tried to add clientY to scrollTop, and many other combinations but can't make it work. I have a lot of other javascript functionality in the page that is working.
Hi! I've seen your recommendation, but that code is for dragging the image. I don't want to move (or dragg) the image in my div, I only want to move the scrolls, but not the image.
Hi! I've a DIV which contains an IMG. This image is wider than the div, so a scrollbar appears on page. What I want to do, is click on the div(image) and move the mouse, and scroll the div as I move the mouse.
I'm not certain exactly what you envisage but try this script which doesn't require a click to start it:
Bookmarks