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

  • Home
  • SEARCH
  • 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 8100919
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T22:51:45+00:00 2026-06-05T22:51:45+00:00

The code I’ve pasted below works fine for drawing a line step by step

  • 0

The code I’ve pasted below works fine for drawing a line step by step with a timed interval defined. (it uses a few variables not shown here). The problem I’m having is that if I remove the path object myPath1 or 2 with remove() function in raphael it doesn’t want to draw the next one, or redraw itself. It seems to sort of break the path method.

How should I do this? I want to be able to redraw/reanimate the path, but that requires it to start over at point zero, so I thought I may as well remove it.

var strokes1 = [ { stroke: "M "+second_start_circle+" 20", time: 0},
            { stroke: "l-70 70", time: 200},
            { stroke: "l800 0", time: 400}];

var drawnPath1 = strokes1[0].stroke;
var myPath1 = paper.path(drawnPath1);
myPath1.toBack();
var section1 = 1;
myPath1.attr({
    "stroke-width": 8,
    "stroke": color_services,
    "stroke-opacity": 1
});

function animatePath1() {
    if (section1 < strokes1.length) {
        drawnPath1 += strokes1[section1].stroke;
        myPath1.animate({
            path: drawnPath1
        }, strokes1[section1].time, animatePath1);
        section1++;
    }
}

var strokes2 = [ { stroke: "M "+third_start_circle+" 20", time: 0},
            { stroke: "l-70 70", time: 200},
            { stroke: "l500 0", time: 400}];

var drawnPath2 = strokes2[0].stroke;
var myPath2 = paper.path(drawnPath2);
myPath2.toBack();
var section2 = 1;
myPath2.attr({
    "stroke-width": 8,
    "stroke": color_about,
    "stroke-opacity": 1
});

function animatePath2() {
    if (section2 < strokes2.length) {
        drawnPath2 += strokes2[section2].stroke;
        myPath2.animate({
            path: drawnPath2
        }, strokes2[section2].time, animatePath2);
        section2++;
    }
}
  • 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-05T22:51:46+00:00Added an answer on June 5, 2026 at 10:51 pm

    I changed it into having a remove function. Will have to optimize this code a bit (self learned coder as I’m sure you can see). But now it works like intended.

    var strokes1 = [ { stroke: "M "+second_start_circle+" 20", time: 0},
                    { stroke: "l-70 70", time: 200},
                    { stroke: "l800 0", time: 400}];
    
        var drawnPath1 = strokes1[0].stroke;
        var myPath1 = paper.path(drawnPath1);
        myPath1.toBack();
        var section1 = 1;       
    
        function animatePath1() {
            if (section1 < strokes1.length) {
                drawnPath1 += strokes1[section1].stroke;
                myPath1.attr({
                    "stroke-width": 8,
                    "stroke": color_services,
                    "stroke-opacity": 1
                });
                myPath1.animate({
                    path: drawnPath1
                }, strokes1[section1].time, animatePath1);
                section1++;
            }
        }
        function removePath1(){
            if (section1 == strokes1.length) {
                myPath1.remove();
    
            }
            section1 = 1;
            drawnPath1 = strokes1[0].stroke;
            myPath1 = paper.path(drawnPath1);
            myPath1.toBack();
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

code: <a href=...><img src=..' /><span>..</span></a> works fine in all cases, but <a href=...> <img
Code below works well on Firefox - displays progress bar which progresses on every
Code is as follows but I get a ytplayer is not defined error. Is
Code Snippet: ShippingPeriod[] arrShippingPeriods; . . . List<ShippingPeriod> shippingPeriods = ShippingPeriodList.ToList<ShippingPeriod>(); The Last line
Code below sets default values for new row if row is added using form.
Code below does not run correctly and throws InvalidOperationExcepiton . public void Foo() {
Code below is not working as expected to detect if it is in design
Code below taken from here . * qsort example */ #include <stdio.h> #include <stdlib.h>
Code below is placed in page_Load. How I should handle this to bypass UrlReferrer
Code is as shown below. $('p:first').toggle(function() { $(this).animate({'height':'+=150px'}, 2000, 'linear'); }, function() { $(this).animate({'height':'-=150px'},

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.