Originally posted by NickFitz
					
						
						
							
							
							
							
								
								
								
								
									View Post
								
							
						
					
				
				
			
		 
							
						 Betty
 Betty 
 
							
						
 
							
						
 
							
						



var svgLine = svg.line(
    {
        x1: 0,
        y1: 0,
        x2: 200,
        y2: 200,
        "stroke-width": 15
    });
document.body.appendChild(svg.svg(
    { width:400, height: 400},
    svg.g(
        { stroke: "red" },
        svgLine
    )));
var lineAnimation = Animation.create(svgLine, 
    [
        {
            name: "x1",
            from: 0,
            to: 400
        },
        {
            name: "y2",
            from: 200,
            to: 400
        },
    ],
    { tweening: Animation.tweenings.elasticOut() });
var button = html.button({ type: "button"}, "Animate line");
toolbar.appendChild(button);
button.addEventListener("click", 
    function(event) {
        Animation.start(lineAnimation, 5000);
    },
    true);
 
							
						 
							
						

Comment