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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T02:13:38+00:00 2026-06-04T02:13:38+00:00

My aim is to create identify a piece of code that increments a number

  • 0

My aim is to create identify a piece of code that increments a number by 1, every 1 second:

We shall call our base number indexVariable, I then want to: indexVariable = indexVariable + 1 every 1 second; until my indexVariable has reached 360 – then I wish it to reset to 1 and carry out the loop again.

How would this be possible in Javascript? – if it makes a difference I am using the Raphael framework.

I have carried out research of JavaScript timing events and the Raphael delay function – but these do not seem to be the answer – can anyone assist?

  • 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-04T02:13:39+00:00Added an answer on June 4, 2026 at 2:13 am

    You can use setInterval() for that reason.

    var i = 1;
    
    var interval = setInterval( increment, 1000);
    
    function increment(){
        i = i % 360 + 1;
    }
    

    edit: the code for your your followup-question:

    var interval = setInterval( rotate, 1000);
    
    function rotate(){
          percentArrow.rotate(1,150,150);
    }
    

    I’m not entirely sure, how your rotate works, but you may have to store the degrees in a var and increment those var too like in the example above.

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

Sidebar

Related Questions

The aim is to create an object that contains a number of WPF windows,
Aim: to create an Infopath form that displays a list of companies in a
I'm working on a simple crawler in Python. The aim is to create a
Here's my aim - to take the ASCII roguelike Angband and create an online
Is it possible to create types like e.g. String(20) in scala? The aim would
Aim: To have the if statement execute a onclick event through code. I currently
The aim: to write a js (using jquery) that will perform 2 blinking of
I aim to make an app that would store sms messages with certain words
What I can do: I aim to create a view where a User Control
My overall aim is to create an editor which I can skin using jQuery

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.