Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8110189
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T01:39:40+00:00 2026-06-06T01:39:40+00:00

I have drawn a coil like structure var pathCommand = M 10 50 l

  • 0

I have drawn a coil like structure

var pathCommand = "M 10 50 l 10 0 ";
for (var i = 0; i < 10; i++) {
 pathCommand += "c  15   0  25 -20  15 -20 " + "c -10   0   0  20  15  20 ";
}
var pc = paper.path(pathCommand);`enter code here`
            pc.attr({
                stroke: '#000',
                'stroke-width': 3
            });

but I want to show this with animation as if it is being drawn pixel by pixel.
I have tried this

var pc = paper.path("M 10 50");
for (var i = 0; i < 10; i++) {
pathCommand += "c  15   0  25 -20  15 -20 " + "c -10   0   0  20  15  20 ";
pc.animate({path: pathCommand, stroke: '#000','stroke-width': 3},2000);
}

this is not giving me what I exactly want.
Can anyone tell me how should I do it to show as this is drawing progrssively, with raphael js??
Thanks for any help

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T01:39:41+00:00Added an answer on June 6, 2026 at 1:39 am
    var s = [ { stroke: "M 150 150", time: 0},
                { stroke: "c  15   0  25 -20  15 -20", time: 800},
                { stroke: "c -10   0   0  20  15  20", time: 600},
                { stroke: "c  15   0  25 -20  15 -20", time: 800},
                { stroke: "c -10   0   0  20  15  20", time: 600},
                { stroke: "c  15   0  25 -20  15 -20", time: 800},
                { stroke: "c -10   0   0  20  15  20", time: 600},
                { stroke: "c  15   0  25 -20  15 -20", time: 800},
                { stroke: "c -10   0   0  20  15  20", time: 600} ];
    var drawnPath = s[0].stroke;
    var myPath = paper.path(drawnPath).attr({"stroke-width": 3,"stroke": "#000"});
    var temp = 1;
    animateMyPath();
    function animateMyPath() {
    if (temp < s.length) {
        drawnPath += s[temp].stroke;
        myPath.animate({path: drawnPath}, s[temp].time, animateMyPath);
        temp++;
        }
    }         
    

    Please tell me is this correct way to do this, as I am new to this javascript programming.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have drawn something like this: How to remove the paths and points?
I have drawn a checkbox in devexpress grid group row using the code below.
I have drawn an image on a Composite using the following code imageCanvas =
I have drawn an icon in Inkscape , but would now like to programmatically
Say I have drawn a triangle with: import flash.geom.Matrix; function drawTriangle(sideLength:uint):void { var triangleHeight:uint
I want to drag and drop that I have drawn on the forms. Here
I have drawn up the following PHP code which processes the data from a
I have drawn a UIView (i.e. UIButton ) in my code for an iPhone
I have drawn an object on NSView subclass. How can the object know that
I have drawn into a CGContext of a UIView. - (void)drawRect:(CGRect)rect { [self drawInContext:UIGraphicsGetCurrentContext()]

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.