Binding mousemove within mousedown function with jQuery
- by colinjameswebb
I am trying to bind a mousemove event to a div when the left mousebutton is down, and unbind when it is released. This code should be fairly self-explainatory.
function handleMouseDown(e, sbar){
if (e.button == 0){
console.log(sbar); //firebug
sbar.bind('mousemove', function(event){
handleMouseMove(event, sbar);
…