我有以下功能:
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);
};
如您所见,它会在每次鼠标按下时触发。我drag
只想在第一次鼠标按下后触发该功能一次。我应该.one()
为此使用jQuery吗?
提前致谢。