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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T03:36:15+00:00 2026-06-12T03:36:15+00:00

Open this JS Fiddle Link . There are two paths which are animating. the

  • 0

Open this JS Fiddle Link. There are two paths which are animating. the dark blue bar animates according to minutes passed & the smaller green bar animates according to seconds. I want to loop this animations when they complete their animation. How can I do that?

JS Fiddle Link

window.onload= function aa () {

    var paper = Raphael(0, 0, 1900, 1900);
    var date = new Date;
    var hour = date.getHours();

    var mins = date.getMinutes();
    var secs = date.getSeconds();
    var secl = (60*60*1000)-(secs*1000);
    var minl = 60 - mins;
    var crx = 318*(mins/60);//sets width according to minutes passed when window is loaded

    var cry = 318*(secs/60);//sets width according to seconds passed when window is loaded
    var sec1 = (60-secs)*1000;

    var x=1;
    var y=1;

    var pathhh = "M"+x+","+y+" "+"h"+320+" "+"v"+270+" "+"h"+(-320)+"z";//bg
    var curbox = paper.path(pathhh).attr({fill:'315-#0299fa-#0473ba'});

    var pathh3 = "M"+(x+1)+","+(242+y)+" "+"h"+318+" "+"v"+27+" "+"h"+(-318)+"z";//black bar
    var cur1box = paper.path(pathh3).attr({fill:'black'});    

    var pathfm = "M"+(x+1)+","+(243+y)+" "+"h"+crx+" "+"v"+20+" "+"h"+"-"+crx+"z";//minutes bar
    var pathto = "M"+(x+1)+","+(243+y)+" "+"h"+318+" "+"v"+20+" "+"h"+(-318)+"z";
    var cu2box = paper.path(pathfm).attr({fill:'#03558b',stroke:'none'});
    cu2box.animate({path: pathto},secl);

    var patgfm = "M"+(x+1)+","+(265+y)+" "+"h"+cry+" "+"v"+4+" "+"h"+"-"+cry+"z"; //seconds bar
    var patgto = "M"+(x+1)+","+(265+y)+" "+"h"+318+" "+"v"+4+" "+"h"+(-318)+"z";
    var cu3box = paper.path(patgfm).attr({fill:'#0db1af',stroke:'none'});
    cu3box.animate({path: patgto},sec1);
};

​

  • 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-12T03:36:16+00:00Added an answer on June 12, 2026 at 3:36 am

    I think this question is relevant, while not quite the same as yours. The question and the answer together contain the solution for your case: use the callback at the end of the animation, reset the path to the original and set the new animation.

    Alternatively, use setInterval to reset the animation every minute/hour.

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

Sidebar

Related Questions

I have this fiddle: http://jsfiddle.net/9J5Fg/ When one box is open and I click on
This code behaves funny on Chrome (fiddle here ): try { open('6:-='); } catch(e)
In this jsfiddle , please follow the steps below: 1: When you open fiddle
In this fiddle, click the Policies button, click the New policy button and, according
Firefox doesn't know how to open this address because the protocol (c) isn't associated
I have other-window.xaml file and trying to open this from window.xaml on button click.
I have an sql file in my supporting files. How can I open this
I have an excel spreadsheet that is password-protected. I need to open this spreadsheet
I have for example .pdf file (path to that file). How to open this
I found this open question online. How do you process a large data file

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.