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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T02:41:10+00:00 2026-05-26T02:41:10+00:00

Here is the javascript function in which I am trying to bring about a

  • 0

Here is the javascript function in which I am trying to bring about a sliding effect.

What I want is, upon clicking the right button (green coloured button), the sliding effect should replace the tab with another tab, all are block elements.

However, the effect is not working & I am sure I am doing something wrong with the jquery code. (the fade effect works fine on the left button (orange coloured button).

    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;
        if (iActiveNo != 1 || iActiveNo != 0)
        {
            $(eTabsDiv.children[iActiveNo - 1]).stop() .animate({"left" : "300px"}, 500);
            eTabsDiv.children[iActiveNo - 1].style.display = "none";
            eTabIndDiv.children[iActiveNo - 1].style.backgroundColor = "rgb(122,121,198)";            
        }
        **$(eTabsDiv.children[iActiveNo]).stop() .animate({"left" : "300px"}, 500);**
        eTabsDiv.children[iActiveNo].style.display = "block";
        eTabIndDiv.children[iActiveNo].style.backgroundColor = "rgb(0,100,200)";        
    }
    activateFeaturesContainer(direction);
    return iActiveNo;
}

Here is the complete code (rather long) but it gives an idea of the effect I am trying to achieve.

Jsfiddle

  • 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-26T02:41:10+00:00Added an answer on May 26, 2026 at 2:41 am

    I think what you want is something like this: http://www.apple.com/macbookair/

    For that, you first have to give div#features an overflow: hidden, otherwise, the content is not hidden while traveling to the left/coming in from the right.

    You then have to position the new ul just outside the the viewable area and make it visible, otherwise the new content doesn’t come in from the right (assuming it is what you want). In your case, you have to set left: 292; display: block. Now, you select both the old and new ul and apply an animation of left: '-=292px'. You then hide the old one. That should about do it.

    var jNew = $(eTabsDiv.children[iActiveNo]);
    var jOld = $(eTabsDiv.children[iActiveNo-1]);
    jNew.css({
       'left': 292,
       'display': 'block'
    });
    jNew.add(jOld).stop(true).animate({
       'left': '-=292px'
    }, function() {
       jOld.hide();
    });
    

    Notes:

    • Because of overflow: hidden, you have to set a clearly defined height. height: auto has no meaning anymore since the div does not grow with its content anymore. Ideally, you adjust the height via JS to its children.

    • I am working with the static values in your code to make a simple explanation. If div#features ever changes width, you have to change it in the code too. For better maintenance, I’d suggest you get the width of div#features with .outerWidth(), and base your animation off of that value

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

Sidebar

Related Questions

Trying to truncate some code here and running into a problem: <script type=text/javascript> $(function()
I've been trying to somehow get my javascript function (which I have in the
I need to pass an url from asp.net load_page to flowplayer javascript function here:
I call a javascript function from a textbox by using OnKeyPress=clickSearchButton() Here is my
Window.open javascript function is not working in Mozilla, but working in other browsers, here
here is some sample javascript: SomeObjectType = function() { } SomeObjectType.prototype = { field1:
Here is function , <script type=text/javascript> $(document).ready(function() { getRecordspage(1, 5); $(a.page-numbers).click(function() { alert(1); getRecordspage($(this).text(),
$('#selector').click(function() { // here I would like to load a javascript file // let's
It is valid JavaScript to write something like this: function example(x) { Here is
Here is the situation. I have some javascript that looks like this: function onSubmit()

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.