Here is an example of a violin: you click on the red frame and on it indicate the coordinates of your pointer relative to the field.
How do I change this script to allow coordinates if I click and drag? Allowing coordinates to be updated live when I hold the click and move the mouse.
http://jsfiddle.net/lonesomeday/5qxtL/2/
Code from script:
$('#target').mousedown(function(e) { var offset = $(this).offset(), imgLeft = e.pageX - offset.left, imgTop = e.pageY - offset.top; $('#result').text('Mouse clicked x = ' + imgLeft + ' Y = ' + imgTop); });
I tried several different things, but so far nothing has worked and cannot find another question that is similar except one without an answer.
thanks
source share