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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T09:15:00+00:00 2026-06-14T09:15:00+00:00

I am combining some animations in jquery with some ajax loading – From function

  • 0

I am combining some animations in jquery with some ajax loading – From function A, I want to be able to call function B to fade out the current content, and once that animation is done, return to run the rest of the code in function A. Is this possible? I’m picturing something like this:

function buttonClicked(){
  if(sectionHidden != true){
    hideSection($sectionRef);
  }
  //RUN THE FOLLOWING AFTER HIDE SECTION HAS FINISHED (FUNCTION B)
  loadSection();
}

function hideSection($sectionRef){
  $sectionRef.fadeTo(500,0,function(){
    return someValue;
  });
}

Because of some other complexities in my code (multiple functions calling hideSection), I can’t call loadSection from hideSection.

  • 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-14T09:15:01+00:00Added an answer on June 14, 2026 at 9:15 am

    .fadeTo() takes a callback parameter which is called when the fade-out is finished. All you have to do is supply it the loadSection function. To wit:

    function buttonClicked() {
        if (!sectionHidden) {
            hideSection($sectionRef, loadSection);
        }
        else {
            loadSection();
        }
    }
    
    function hideSection($sectionRef, doneCallback) {
        $sectionRef.fadeTo(500, 0, doneCallback);
    }
    

    If you don’t want to load the section after calling hideSection() from another part of your code:

    function someStuff() {
        //stuff...
       hideSection($superRef); //won't call loadSection()
       //more stuff
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need some help in combining a stored procedure with another function. I've got
I'm combining some CSS files and writing them to a file in a separate
Greetings all, I need help combining some htaccess rewrites, these crazy regular expressions screw
I'm developing a Cocoa application and want to be able to click a button
I have some problems combining a custom marker icon with my infoWindow. Here is
I am in desperate need for some algorithm help when combining lists inside lists.
Suppose that I have stashed some changes and I want to add further changes
Possible Duplicate: Combining jQuery :not and :nth-child selectors is this possible? Here is my
I've several tables including the 'combining' in many-to-many relationship. I want to make now
I'm using HighStock to generate some charts in browser. But now I want to

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.