More information about the Underscore mailing list

[_] Mouse status with Javascript

Tim Beadle tim.beadle at gmail.com
Thu Mar 22 13:10:22 GMT 2007

On 22/03/07, David Elliott <the1gadget at gmail.com> wrote:
> What I am doing is using the onclick handler to call a function. I then want
> to see if the mouse is still down and if so call the routine again.

Set a variable (perhaps "mouseIsDown" - default value should be false)
to be true using something called by the mousedown event. Set the
variable back to false using the mouseup event.

Then use a while loop (while (mouseIsDown) {...}) to call your routine
that needs to be called while the mouse is down.

Tim