edlopez

wind rose

Mar 25th, 2012
167
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
jQuery 0.52 KB | None | 0 0
  1. $("#scale").click(
  2.     function() {
  3.         for (i=0; i<16; i++) {
  4.             angle = (i+1)*22.5;
  5.             console.log('here:'+i); // message
  6.             $('#gToTransform').clone() // we clone the template object
  7.             .attr('id', 'gToTransform-'+i) // we change its @id to prevent further conflict
  8.             .appendTo('svg') // we append the clone at the end (inside) on the <svg>
  9.             .attr('transform', 'translate(110, 110) rotate('+angle+' 0 0)'); // update the @tranform value
  10.         }
  11.     }
  12. )
Advertisement
Add Comment
Please, Sign In to add comment