Created
April 3, 2015 09:28
-
-
Save higumachan/d7853ef23dea93212f62 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function drag(callback){ | |
var downFlag; | |
mouseDown(function(x, y){ | |
downFlag = true; | |
}); | |
mouseUp(function(x, y){ | |
downFlag = false; | |
}); | |
mouseMove(function(x, y){ | |
if (downFlag){ | |
fn(x, y); | |
} | |
}); | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment