Skip to content

Instantly share code, notes, and snippets.

@brainwipe
Created November 21, 2013 16:29
Show Gist options
  • Save brainwipe/7584970 to your computer and use it in GitHub Desktop.
Save brainwipe/7584970 to your computer and use it in GitHub Desktop.
Using Snap.svg to animate a rectangle
<svg id="svg" version="1.1" xmlns="http://www.w3.org/2000/svg"></svg>
<script>
var s = Snap("#svg");
var rect = s.rect(10, 10, 100, 100);
rect.animate({
x: 50,
y: 50
}, 1000);
</script>
@brainwipe
Copy link
Author

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