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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T04:07:26+00:00 2026-05-26T04:07:26+00:00

All, Am using jquery to animate a sliding effect on the li elements. While

  • 0

All,

Am using jquery to animate a sliding effect on the li elements. While I have managed to create the sliding effect, it is not being animated correctly.

Issue:
I think the issue is to with the jquery animation timing, which conflicts with the rest of the code immediately below the jquery animate call.

Code:
Here is the relevant code for review (jsfiddle link underneath):

    function activateRightTab()
{
    var eTabIndDiv = document.getElementById ("feature_tabs_indicators").children[0];
    var iIndsCount = eTabIndDiv.childNodes[1].children.length;
    var direction = "right";
    if (iActiveNo < iTabsCount - 1 && iActiveNo >= 0)
    {
        iActiveNo = iActiveNo + 1;
        var eCurrentTab = eTabsDiv.children[iActiveNo];
        var ePreviousTab = eTabsDiv.children[iActiveNo - 1];
        if (iActiveNo > 0)
        {
            ePreviousTab.style.position = "relative";
            $(ePreviousTab).animate({"right" : "210px"}, 250);
            $(eTabIndDiv.children[iActiveNo - 1]).animate({"width" : "12px"}, 250).animate({"width" : "18px"}, 125);

            // ****** the following three lines conflict with the above jquery line ******  

            self.setTimeout(ePreviousTab.style.width = "0", 250);
            ePreviousTab.style.color = "transparent";
            ePreviousTab.style.position = "static";
        }
        eCurrentTab.style.position = "relative";
        eCurrentTab.style.right = "-210px";
        eCurrentTab.style.width = "210px";
        eCurrentTab.style.backgroundColor = "rgb(165,145,176)";
        eCurrentTab.style.color = "black";
        $(eCurrentTab).animate({"right" : "10px"}, 250).animate({"right" : "0"}, 125);
        $(eTabIndDiv.children[iActiveNo]).animate({"width" : "127px"}, 250).animate({"width" : "121px"},125);
    }
    if (iActiveNo === iTabsCount - 1 && eRightScrollButton.style.opacity === "0.5")         //springy effect when no other right tab
    {
        $(eTabsDiv.children[iActiveNo]).animate({"right" : "10px"}, 100).animate({"right" : "-5px"}, 45).animate({"right" : "0"}, 10);          
    }
    (iActiveNo === iTabsCount - 1) ? eRightScrollButton.style.opacity = "0.5" : false;
    activateFeaturesContainer(direction);
    return iActiveNo;
}

Here is the working prototype on jsfiddle (press the light green button ‘rght’ button on the right)

  • 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-26T04:07:27+00:00Added an answer on May 26, 2026 at 4:07 am

    Don’t use timeouts to dictate when to set the css.

    The .animate() function comes with a complete callback that will run when the animation is completed.

    $(eTabIndDiv.children[iActiveNo - 1])
                    .animate({width: "12px"}, 250)
                    .animate({width: "18px"},
                             {complete: function(){
                                 ePreviousTab.css('width', '0');
                              }, 
                              duration: 125});
    

    http://jsfiddle.net/RtaK7/4/

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

Sidebar

Related Questions

I have a large nested list that I am trying to animate using jquery
I am animating html elements (cards) using jquery. I need to animate a dealing
I have made a Web page using jquery and php where all files are
I'm trying to get an element to animate a rotation hover effect using jquery,
I have a little Problem using jQuery.animate with firefox: when i animate the height
I'm using jQuery's animate function to animate a series of matching elements, but I
I would like to print the selected values of all selects using jQuery. I
Using jQuery, is there a way to select all tag that reference a specific
Using jQuery, how do I delete all rows in a table except the first?
Is it possible using jQuery to select all <a> links which href ends with

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.