views:

336

answers:

1

I want to use javascript to detect the mouse position once the mousedown event has fired. It appears I am not getting an onmousemove event when the left button is held down. The cursor is changing to some circle with a cross through it.

My whole goal is to detect the start position of the cursor on mousedown and change the top left style of a image in a div with overflow set (kind of fake pan effect).

Thanks

+1  A: 

Set up an ondragstart handler:

function dragstart(ev)
{
    if (!ev) ev = window.event;
    ev.returnValue = false;
    return false;
}

image.ondragstart = dragstart;
Greg Hewgill
that doesn't seem to be an attribute for an html img or an asp img object tagi am trying to do it for an asp page, if that matters.
Oh, that's Javascript code. I'm not sure what you might need to do to have the same effect in ASP.
Greg Hewgill