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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T01:41:15+00:00 2026-05-25T01:41:15+00:00

I am calling this function function drawLayers() { //setTimeout(drawBlueSky,500); //setTimeout(drawCircle1,1250); setTimeout(drawMoon,800); setTimeout(drawCircle1,2300); setTimeout(drawCircle2,2700); setTimeout(drawCircle3,3100);

  • 0

I am calling this function

function drawLayers() {

    //setTimeout(drawBlueSky,500);
    //setTimeout(drawCircle1,1250);
    setTimeout(drawMoon,800);
    setTimeout(drawCircle1,2300);
    setTimeout(drawCircle2,2700);
    setTimeout(drawCircle3,3100);
    setTimeout(drawCircle4,3500);
    setTimeout(drawCircle5,3900);
    setTimeout(drawtext2,4300);
    setTimeout(drawtext,4700);
    setTimeout(drawtext3,5100);
    setTimeout(drawtext4,5500);
    setTimeout(drawtext5,5900);
    setTimeout(drawtext6,6300);
    setTimeout(drawtext7,6700);
    setTimeout(drawtext8,7100);
    setTimeout(drawtext9,7500);
    setTimeout(drawtext10,7900);

}

which calls many other functions fox ex drawMoon,drawCircle1 etc
I am calling drawLayers() function on click of play button. What I need is if someone clicks on stop button the setTimeout function should stop calling all other functions or stop wherever it is. For ex if drawMoon function is called and someone clicks on stop all other functions drawCircle1,drawCircle2 shouldnt be called.

  1. pause button also there would be third button which when clicked will pause the setTimeout function as above. when i click on same button again it should call function from where it has stopped.

Is this possible?

  • 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-25T01:41:15+00:00Added an answer on May 25, 2026 at 1:41 am

    Have such code:

    var timers = [];
    function drawLayers() {
    
        //setTimeout(drawBlueSky,500);
        //setTimeout(drawCircle1,1250);
    
        timers = [];
        timers.push(setTimeout(drawMoon,800));
        timers.push(setTimeout(drawCircle1,2300));
        timers.push(setTimeout(drawCircle2,2700));
        timers.push(setTimeout(drawCircle3,3100));
        timers.push(setTimeout(drawCircle4,3500));
        timers.push(setTimeout(drawCircle5,3900));
        timers.push(setTimeout(drawtext2,4300));
        timers.push(setTimeout(drawtext,4700));
        timers.push(setTimeout(drawtext3,5100));
        timers.push(setTimeout(drawtext4,5500));
        timers.push(setTimeout(drawtext5,5900));
        timers.push(setTimeout(drawtext6,6300));
        timers.push(setTimeout(drawtext7,6700));
        timers.push(setTimeout(drawtext8,7100));
        timers.push(setTimeout(drawtext9,7500));
        timers.push(setTimeout(drawtext10,7900));
    
    }
    
    function StopAll() {
        for (var i = 0; i < timers.length; i++)
             window.clearTimeout(timers[i]);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am calling this function which is modifying an array by reference: function addWord(&$words,
I have a function like this: MyFunction(double matrix[4][4]) {/*do stuff*/} I am calling this
I'm using a Class Library exporting a function via COM. When calling this function
I'm calling this function but I need to slideup the parent div of the
I am calling this function halfway down the page: <div id=leftArea> <?php if (isset($id)){
I am loading a php file and calling this function decodeJSON want to parse
i am calling this function from the menu and calls the upload(item) function to
I am calling this function, assigning the result to a variable in the callback
i i am checking network type by calling this function ConnectivityManager cm = (ConnectivityManager)
I'm calling this linear class relationship , but correct me if I'm wrong. I'm

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.