Skip to content

Instantly share code, notes, and snippets.

@brainwipe
Created November 27, 2013 11:26
Show Gist options
  • Save brainwipe/7674220 to your computer and use it in GitHub Desktop.
Save brainwipe/7674220 to your computer and use it in GitHub Desktop.
How I would prefer drag() in Snap.svg to work, using a context with named parameters. This will not work in Snap.svg now!
// This is how I would like to use snap.svg's drag method:
var block = s.rect(x, y, 100, 100, 20, 20);
block.drag({
ondrag: function(dragContext, event) {
// drag method here
}
onstart: function(dragContext, event) {
// drag start here
}
});
@brainwipe
Copy link
Author

Snap.svg http://snapsvg.io/
More detail on my blog: http://robsneuron.blogspot.co.uk/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment