Skip to content

Instantly share code, notes, and snippets.

@brainwipe
Last active December 28, 2015 23:59
Show Gist options
  • Save brainwipe/7582860 to your computer and use it in GitHub Desktop.
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.
<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>
@brainwipe
Copy link
Author

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