Skip to content

Instantly share code, notes, and snippets.

Created December 18, 2012 17:51
Show Gist options
  • Select an option

  • Save anonymous/4330269 to your computer and use it in GitHub Desktop.

Select an option

Save anonymous/4330269 to your computer and use it in GitHub Desktop.
function loop(e) {
switch(e.type) {
case 'mousedown':
case 'mouseup':
loop.move = !loop.move;
break;
default:
loop.move && move(e);
}
}
$('#box').mousedown(loop);
$(window).mousemove(loop)
.mouseup(loop);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment