Created
November 21, 2013 16:29
-
-
Save brainwipe/7584970 to your computer and use it in GitHub Desktop.
Using Snap.svg to animate a rectangle
This file contains hidden or 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
<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> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Working example: http://jsfiddle.net/brainwipe/MpBbu/1/