Checking whether a user clicks or drags across an image

D

Dylan Parry

Hi,

I'm not particularly good at JavaScript, so please forgive me if I
appear stupid! :)

Anyway, what I have is an image that I want the user to click on and
either (i) release the mouse straight away or (ii) drag to another
location on the image before releasing the button.

Two problems spring to mind when I think about this: a) how do I tell
whether the user has done operation (i) or (ii), and b) how do I stop
the mouse cursor changing when the user does (ii)?

Preferably, I would like to draw a box showing the area that the user
has dragged over when they perform operation (ii). Is this possible?

Does anyone have any ideas how to do this?

TIA
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,764
Messages
2,569,567
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top