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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T22:17:18+00:00 2026-06-08T22:17:18+00:00

I have a call back, that I call back multiple times ( recursively via

  • 0

I have a call back, that I call back multiple times ( recursively via setTimeOut )…there is only one condition in which I want to capture a return value, that is when the callback is done calling itself back.

However on this condition, when I return something, I don’t get it where I expect to, plus I don’t know where it goes at all. There are two console.log statements marking these points…in the snippet below. One where I send it…and one where I expect it.

        if( MC.C.movePane( pane_element, 0, 0, 0, 'begin' ) ) {
            cover_element.style.display = 'none';
            console.log('I never got it');
        }
        return o_p;
    },
    movePane: function( pane_element, start, end, index, state ) {
        if( ( state === 'begin' ) ) { // init the function
            start = parseInt( window.getComputedStyle( pane_element, null ).getPropertyValue("top"), 10 );
            end = start + 40;
            index = start;
            state = 'down';
            MC.C.movePane( pane_element, start, end, index, 'down' );
        }
        if( ( state === 'down' ) && ( index < end ) ) { // move down
            index += 1;
            pane_element.style.top = ( index ) + 'px';
            setTimeout( function( ){ MC.C.movePane( pane_element, start, end, index, state ); }, 1 );
        }
        else if( ( state === 'down' ) && index === end ) { // hold
            state = 'up';
            setTimeout( function( ){ MC.C.movePane( pane_element, start, end, index, state ); }, 2000 );
        }
        else if( ( state === 'up' ) && ( index > start ) ) { // move up
            index -= 1;
            pane_element.style.top = ( index ) + 'px';
            setTimeout( function( ){ MC.C.movePane( pane_element, start, end, index, state ); }, 1 );
        }
        else if( ( state === 'up' ) && ( index === start ) ) { // all done, return
            console.log('I just returned true');
            return true;
            // document.getElementById( 'po_but_cov' ).style.display='none';
        }
    }
};
  • 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-08T22:17:19+00:00Added an answer on June 8, 2026 at 10:17 pm

    If you’re asking how to recover the return value of movePane() when it’s called from setTimeout(), you can’t. setTimeout() makes no provisions for capturing and returning a value. But that’s OK, because by the time the callback executes, the code that called setTimeout() is no longer running — yes?

    If you want the callback to communicate that it’s done doing something then — hold onto your hat — you’re going to have to give your callback a callback of its very own. When the callback is though doing its time-delayed thing, it can call that callback, which will do whatever the original code would have done if it had gotten the return value.

    Sorry if that makes your head hurt, but that’s just how it works.

    It might look something like (sorry if the parens and braces don’t quite match up)

        MC.C.movePane( pane_element, 0, 0, 0, 'begin', function() {
            cover_element.style.display = 'none';
        });
        return o_p;
    
        // ...
        movePane: function( pane_element, start, end, index, state, myCallback ) {
            // ...
            else if( ( state === 'up' ) && ( index === start ) ) { // all done, return
                console.log('I just returned true');
                // return true;
                myCallback();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a call back url, that i'm am pulling out the Lat and
I have a WCF service implemented with a call back contract that I am
So I have a user control that exists multiple times on a page. From
I have an issue that looks like a race condition with a webview callback
I have a remote server which handles various different commands, one of which is
I am building a multi-tier application that will have multiple smaller apps apart from
I have an application in which I'd like one row at a time to
I have a method that I call to make web service requests using GET.
I have a situation where I have a callback that I want to execute
Here's the deal: I have an Android application that needs to call a web

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.