Checking whether a user clicks or drags across an image

Discussion in 'Javascript' started by Dylan Parry, Feb 14, 2005.

  1. Dylan Parry

    Dylan Parry Guest

    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

    --
    Dylan Parry
    http://webpageworkshop.co.uk -- FREE Web tutorials and references
    Dylan Parry, Feb 14, 2005
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Ollie
    Replies:
    3
    Views:
    409
    Saber
    Jul 24, 2004
  2. Replies:
    1
    Views:
    375
  3. Jonck
    Replies:
    3
    Views:
    2,332
    Jonck
    Oct 25, 2004
  4. PontiMax

    Clicks and double-clicks

    PontiMax, Jul 14, 2004, in forum: ASP .Net Datagrid Control
    Replies:
    2
    Views:
    182
    Eliyahu Goldin
    Jul 14, 2004
  5. Kenjis Kaan
    Replies:
    4
    Views:
    172
    Tad McClellan
    Sep 3, 2003
Loading...

Share This Page