cj333 0 Newbie Poster

Hi, I want to draw a shape during 5 seconds, like this. I use raphael js library. But how to draw the line after animation? (I mean draw the moving trajectory). Thanks.

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
    <html lang="en">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <script src="raphael-min.js" type="text/javascript" charset="utf-8"></script>
    <script type="text/javascript" charset="utf-8">
    window.onload = function () {
    	var r = Raphael(0, 0, 500, 600);
    	var p = r.path("M100,100c0,50 100-50 100,0c0,50 -100-50 -100").attr({stroke: "none"}),
        e = r.ellipse(104, 100, 4, 4).attr({stroke: "none", fill: "#f00"})
    	e.attr({rx: 5, ry: 5}).animateAlong(p, 5000, true);
    }
    </script>
    </head>
    <body>
        <div id="stroke"></div>
    </body>
    </html>