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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T15:48:37+00:00 2026-05-30T15:48:37+00:00

Using JavaScript to dynamically add and animate text in a specific group in SVG,

  • 0

Using JavaScript to dynamically add and animate text in a specific group in SVG, I’m getting a very bothersome problem that just doesn’t make any sense to me. Based on the documentation, each animate element should individually affect only their direct parent element, which is in this case each individual text element. The problem is that, say I create one animated text element at 0s and another at 1s, and the animation for both of them lasts 2s. The one started at 1s will be halfway through its animation. Then, to make matters worse, every animate thereafter is basically stuck at the end of their cycle.

I’ve tried setting begin="indefinite" and firing it off with element.beginElement(), but this produces the same problem. I’ve checked the structure using Chrome’s element inspector and there isn’t any problem–every animate is inside of a text and every text is inside of the g.

Why is it doing this and how do I make each animate unique?

  • 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-30T15:48:39+00:00Added an answer on May 30, 2026 at 3:48 pm

    After a LOT of fiddling I managed to find a very choppy workaround by calculating the time offset between when the document was loaded and when the animate element is created, setting the begin attribute to that amount divided by 1000.

    starttime=+new Date
    begin=(+new Date-starttime)/1000
    

    I would still like a better solution, however… is there any more efficient way to make an animate element begin when it’s created rather than recording and calculating timestamps? At the very least I’d like to use wallclock() because that’d save the choppy calculations, but I can’t get that to work.

    Edit: I’ve found a better solution which works well: SVG.getCurrentTime()

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

Sidebar

Related Questions

I'm trying to add a text field to a form dynamically using javascript. From
I'm using the After Effects CS3 Javascript API to dynamically create and change text
I'm trying to dynamically add a css stylesheet rule using javascript, something like example
How can I add the href attribute to a link dynamically using JavaScript? I
I'm using javascript to dynamically add new tabs in jquery. I use the following
Using Javascript and html: I have a list containing radio buttons that is dynamically
I want to dynamically add search box using Javascript to web-page like shown here
I add input text box dynamically and trying to pass values using POST method
I'm using javascript to dynamically add spans to the html on my page, and
I try to add dynamically an iframe to a web page using JavaScript. I

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.