Skip to content

Instantly share code, notes, and snippets.

@royhowie
Created October 6, 2015 21:34
Show Gist options
  • Save royhowie/dfdfb94322f9cbe67f85 to your computer and use it in GitHub Desktop.
Save royhowie/dfdfb94322f9cbe67f85 to your computer and use it in GitHub Desktop.
velocity.js usage
<!DOCTYPE html>
<html lang="en">
<head>
<title>Test1 Velocity</title>
<script src="./velocity.js"></script>
<script>
function press () {
Velocity(document.getElementById("sq"), { opacity: 0.3}, { duration: 2000, easing: "ease-in-out", loop: 5 });
return false;
}
</script>
</head>
<body>
<h1>Sample SVG with Velocity</h1>
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="400" height="400">
<rect id="sq" x="25" y="25" width="200" height="200" fill="lime" stroke-width="4" stroke="pink" onclick="press()"/>
</svg>
</body>
</html>
@royhowie
Copy link
Author

royhowie commented Oct 6, 2015

note that "velocity.js" is in the same directory as "velocity.html"

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