Skip to content

Instantly share code, notes, and snippets.

@WebReflection
Created December 18, 2012 17:56
Show Gist options
  • Select an option

  • Save WebReflection/4330350 to your computer and use it in GitHub Desktop.

Select an option

Save WebReflection/4330350 to your computer and use it in GitHub Desktop.
function loop(e) {
if (e.type == 'mousedown') loop.move = true;
if (e.type == 'mouseup') loop.move = false;
if (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