I'm writing a script for dragging an element along an arc, for a unique scrollbar. I realize some of you will have usability objections to this, but I want to get it working if for no other reason than to prove that I can, and maybe teach myself something along the way. I've got an algorithm worked out, but it needs to be able to calculate the position of the cursor relative to the upper left hand corner of the <div> containing the image that serves as the "handle" for the scrollbar. Once I know that, I can use an arctangent calculation to work out the angle from the center of the arc to the cursor, and move the handle accordingly, but the Javascript event model only supports event.layerX/Y, event.offsetX/Y, and event.pageX/Y. Since the initial event is triggered by a mousedown on the image and only the image, and the image will be repositioned as the script runs, I can't work out a reliable way to get the cursor's position relative to the parent <div> ..

Anyone care to throw me a bone here? I'd greatly appreciate it..