Last active
December 28, 2015 23:59
-
-
Save brainwipe/7582860 to your computer and use it in GitHub Desktop.
jQuery SVG 1.4.5 (jQuery 1.7) animating a simple rectangle as found on the jQuery SVG site.
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 class="svg" version="1.1" xmlns="http://www.w3.org/2000/svg"></svg> | |
<script> | |
$(".svg").svg(); | |
var svg = $(".svg").svg('get'); | |
var myrect = svg.rect(25, 25, 150, '25%', 10, 10, | |
{fill: 'none', stroke: 'blue', strokeWidth: 3, | |
transform: 'rotate(0, 100, 75)'}); | |
$(myrect).animate({svgWidth: 200, svgHeight: '30%', | |
svgStroke: 'aqua', svgStrokeWidth: '+=7', | |
svgTransform: 'rotate(60, 100, 75)'}, 2000); | |
</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/RD5Xq/