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 6113439
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T14:51:33+00:00 2026-05-23T14:51:33+00:00

I’m trying to create an animation where I create 4 circles in Raphael 10

  • 0

I’m trying to create an animation where I create 4 circles in Raphael 10 seconds after the page is loaded. Then, 10 seconds later, I want to remove all of these circles, and make 10 more (10 new circles with names that are different than the original 10).

This is what I have:

var paper = Raphael(0, 100, 1350, 800);

setTimeout(function() {
    var a1 = paper.circle(200,200,100);
    var a2 = paper.circle(300,300,100);
    var a3 = paper.circle(400,400,100);
    var a4 = paper.circle(500,500,100);
}, 10000);

setTimeout(function() {
    a1.remove();
    a2.remove();
    a3.remove();
    a4.remove();

    var b1 = paper.circle(300,200,100);
    var b2 = paper.circle(400,300,100);
    var b3 = paper.circle(500,400,100);
    var b4 = paper.circle(600,500,100);
}, 20000);

However, when I get to the send setTimeout, the .remove()‘s don’t do anything. They kill the rest of the script. When I take them out, the new circles create just fine, but I can’t get rid of the first set.

I understand this is something with the bindings, but I can’t get it to work. I tried doing this in the first setTimeout:

setTimeout(function() {
    var a1 = paper.circle(200,200,100);
    $(a1.node).live();
    var a2 = paper.circle(300,300,100);
    $(a2.node).live();
    var a3 = paper.circle(400,400,100);
    $(a3.node).live();
    var a4 = paper.circle(500,500,100);
    $(a4.node).live();
}, 1000);

But when it gets to the first .live() it dies.

Any advice? I feel like there is something very basic that I’m missing. Maybe some behind the scenes explanation as to what it’s trying to do?

I will be expanding this to almost 100 frames (100 setTimeouts). Any advice on how to make this more efficient? I’m a bit new to this. Any advice would be appreciated.

  • 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-05-23T14:51:34+00:00Added an answer on May 23, 2026 at 2:51 pm

    That’s because the circles were declared inside the anonymous function passed to the first setTimeout. If you remove the var from the variable declarations, they will be global, and your code should work.

    By global I mean they will belong to window. You can reference them as window.varname, or just varname (if there is no other var varname in the same scope where you are trying to reference varname).

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

Sidebar

Related Questions

Basically, what I'm trying to create is a page of div tags, each has
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I'm trying to create an if statement in PHP that prevents a single post
I am trying to understand how to use SyndicationItem to display feed which is
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I want to count how many characters a certain string has in PHP, but
For some reason, after submitting a string like this Jack’s Spindle from a text
I have a French site that I want to parse, but am running into
I want use html5's new tag to play a wav file (currently only supported

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.