Mouse events

R

RC

I know some JavaScript mouse events are:

onClick, onMouseOver, onMouseOut, onMouseDown and onMouseUp.

Are there more like:

onMousePress, onMouseDrag, onMouseMove

In Java there are:

mouseClicked, mouseEntered, mouseExited, mousePressed, mouseReleased,
mouseDragged, mouseMoved and mouseWheelMoved.

Also in Java can detected which mouse button (left, middle or right)
has pressed, released or dragged.

Thank Q!
 
E

Eric Ryan Harrison

JS does not provide convenient little functions for you to get all of
that data, but the event itself has this information available to it. I
recommend reading http://www.quirksmode.org/js/events_properties.html
to get a better handle on what can be done here.

This should handle that stuff. Most people doing extensive event work
like this usually write little wrappers for event management that
provide cleaner functionality. Look into prototype.js or dojo's events
system for some examples.

-E
 

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,768
Messages
2,569,575
Members
45,051
Latest member
CarleyMcCr

Latest Threads

Top