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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T21:36:16+00:00 2026-05-26T21:36:16+00:00

Hey guys this is a snippet of my current code. I want to know

  • 0

Hey guys this is a snippet of my current code. I want to know how to add an “onFinish or Finished” event listener to this code.

this is the setStage function

    function setStage($section)
    {

    switch($section)
    {
        case "about":
            if (stageSet == true)
            {
                resetStage();
            }
            $("#one").animate({ width: "+=30", height: "+=30"}, 1000);
            $("#two").animate({ width: "+=30", height: "+=30"}, 1000);
            $("#three").animate({ height: "+=30"}, 1000);
            $("#four").animate({ width: "+=30"}, 1000);
            $("#five").animate({ width: "+=30"}, 1000);
            stageSet = true;
            break;
        case "portfolio":
            if (stageSet == true)
            {
                resetStage();
            }
            $("#one").animate({ width: "+=30", height: "+=30"}, 1000);
            $("#two").animate({ width: "+=30", height: "+=30"}, 1000);
            $("#three").animate({ height: "+=30"}, 1000);
            $("#four").animate({ width: "+=30"}, 1000);
            $("#five").animate({ width: "+=30"}, 1000);
            stageSet = true;
            break;
        case "contact":
            if (stageSet == true)
            {
                resetStage();
            };
            $("#one").animate({ width: "+=30", height: "+=30"}, 1000);
            $("#two").animate({ width: "+=30", height: "+=30"}, 1000);
            $("#three").animate({ height: "+=30"}, 1000);
            $("#four").animate({ width: "+=30"}, 1000);
            $("#five").animate({ width: "+=30"}, 1000);
            stageSet = true;
            break;
        case "resume":
            if (stageSet == true)
            {
                resetStage();
            }
            $("#one").animate({ width: "+=30", height: "+=30"}, 1000);
            $("#two").animate({ width: "+=30", height: "+=30"}, 1000);
            $("#three").animate({ height: "+=30"}, 1000);
            $("#four").animate({ width: "+=30"}, 1000);
            $("#five").animate({ width: "+=30"}, 1000);
            stageSet = true;
            break;
        default:
            alert('not a valid section');
            break;
        }
    }

the animations inside each case will be unique, but I just made the animations identical for now. Below is what happens on the click. What I need it to do is apply a class “off” to each nav, which it does, and then when setStage is finished I need it to take off the class

$(".nav-btn").click(function()
{
    var section = $(this).attr("title");
    //turn off pointer for obsessive clickers
    $(".nav-btn").addClass("off");

    onComplete: function(setStage(section)
    {
        $(".nav-btn").removeClass("off");
    });
});

this of course doesn’t work. The setStage function works great, what I want to do is remove the class when the function finishes. I checked the api event section on the jquery site and didn’t see anything that would suffice, maybe I’m just not looking hard enough. http://api.jquery.com/category/events/ or maybe I’m looking in the wrong section all together. Any thoughts? Thanks in advance for assisting me in my noobness.

  • 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-26T21:36:16+00:00Added an answer on May 26, 2026 at 9:36 pm
    var removeClass = function() {
        $(this).removeClass("off");
    }
    
    
        function setStage($section)
    {
    
    switch($section)
    {
        case "about":
        case "portfolio":
        case "resume":    // and so on
    
            if (stageSet == true)
            {
                resetStage();
            }
            $("#one").animate({ width: "+=30", height: "+=30"}, 1000, removeClass );
            $("#two").animate({ width: "+=30", height: "+=30"}, 1000, removeClass);
            $("#three").animate({ height: "+=30"}, 1000, removeClass);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hey guys, I got this JS code and want to add a slight fade
Hey guys this is my html code: <div class=nakupy> <li class=icn_kategorie><a href=#>Nákupy</a> <div class=sub_menu>
Hey guys - I know this is not a strictly programming question but I'm
Hey guys I'm running this code in Android: public ServiceServer(String serverName) { this.serverName =
Hey guys I cant manage with this code. The idea is to return default
Hey Guys i got this code in my Activity: public class MYAppActivity extends Activity{
Hey guys i want to parse this type of string: {1: [ {OrderItemId:832,ItemId:995,Price:0}, {OrderItemId:833,ItemId:997,Price:0},
Hey guys this is a stored procedure that updates the PrevLoc field..but I want
Hey guys I'm working with this forum, I want to hide the categories list,
Hey guys I feel like this is a simple question, but I don't know

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.