I have the following function:
div_paper.onmousedown = function(event) { var mouseCoords = getCoords(event); startX = mouseCoords.x - offset[0]; startY = mouseCoords.y - offset[1]; rect = paper.rect(startX, startY, 0, 0); document.onmousemove = doDraw; // the function below i would like to fire once rect.drag(drag_move, drag_start, drag_up); }; which fires, as you can see, on every mousedown. I would like to fire the drag function only once, after the first mousedown. Should I use jQuery .one() for that?
Thanks in advance.
fired = falseand then once the function is called once set the flag to true.