views:

71

answers:

1

How can I check if an element is being hovered over and/or clicked on and/or dragged? I need this info so I can stop infinite loops for the duration of the drag.

+1  A: 

You can use jQuery UI's Draggables feature. It allows you to set a callback function for when the drag starts. Documentation is at http://jqueryui.com/demos/draggable/#event-start. It also has a callback for during a drag.

You can already set callback functions for hover and click via jQuery's click() and mouseover() events. http://docs.jquery.com/Events

kbosak