Possible Duplicate:
jQuery: a question on events
How can I do with jQuery so that a mousemove event is active only if the left mouse button is being kept pressed, and as soon as the button gets released the mousemove event stops? All that is to be done within the div element.