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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T00:46:08+00:00 2026-05-24T00:46:08+00:00

I am getting a very weird jQuery effect on a website I am building.

  • 0

I am getting a very weird jQuery effect on a website I am building.

http://www.real-visual.com/site/Technology/

On this page, in the left panel, you will see 4 orange links. If you click one, it slides open a content panel. Then, if you click a different orange link, it slides closed the first panel and slides open the second one.

However, you will notice a weird effect where, when a slide is sliding closed, the content inside it changes.

Here is an example of the jQuery code that powers these slides:

$("#panel-2-button").click(function() {
    if ($('.togglepanel').is(':visible')) { $(".togglepanel").hide("slide", { direction: "left" }, 1000); }
    $("#content-inner-panel-2").toggle("slide", { direction: "left" }, 1000); 
});
$("#panel-2-button-medium").click(function() {
    if ($('.togglepanel').is(':visible')) { $(".togglepanel").hide("slide", { direction: "left" }, 1000); }
    $("#content-inner-panel-2-medium").toggle("slide", { direction: "left" }, 1000);
});
$("#panel-2-button-large").click(function() {
    if ($('.togglepanel').is(':visible')) { $(".togglepanel").hide("slide", { direction: "left" }, 1000); }
    $("#content-inner-panel-2-large").toggle("slide", { direction: "left" }, 1000);

});

And here is an example of the HTML:

<div id="content-inner-panel-2-medium" class="togglepanel">
    <h1>Microsoft Kinect</h1>
    <p>Text Here</p>
    <div id="panel-2-close-medium"></div>
</div>

 <div id="content-inner-panel-3-medium" class="togglepanel">
    <h1>Large Screen & Immersive</h1>
    <p>Text Here</p>
    <div id="panel-3-close-medium"></div>
 </div>

  <div id="content-inner-panel-4-medium" class="togglepanel">
    <h1>Mobile Phones & Tablets</h1>
    <p>Text Here</p>
    <div id="panel-4-close-medium"></div>
  </div>

  <div id="content-inner-panel-5-medium" class="togglepanel">
    <h1>Games Controllers & Remotes</h1>
    <p>Text Here</p>
    <div id="panel-5-close-medium"></div>
  </div>

Does anyone know why the weird content-switcharound bug is occuring when a slide closes and how to fix it?

  • 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-24T00:46:10+00:00Added an answer on May 24, 2026 at 12:46 am

    The problem is the line:

    if ($('.togglepanel').is(':visible')) { $(".togglepanel").hide("slide", { direction: "left" }, 1000); }
    

    specifically:

    $(".togglepanel").hide("slide", { direction: "left" }, 1000);
    

    That line hides the first element in the .togglepanel that it finds (which would be the Kinect one) and hides that. You need to find the id of the visible .togglepanel and hide that id, not just class:

    var visiblepanel = 'none';
    $('.togglepanel').each(function(){
        if ($(this).is(':visible')) {
            visiblepanel = $(this).attr('id');
        }
    });
    if (visiblepanel != 'none'){ $(visiblepanel).hide("slide", { direction: "left" }, 1000); }
    

    that last line might need to prepend the # symbol like so:

    if (visiblepanel != 'none'){ $('#' + visiblepanel).hide("slide", { direction: "left" }, 1000); }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following code: http://jsfiddle.net/8fvJN/15/ I am getting a very weird effect when
I'm getting this very weird error. I call it weird because the full error
I'm getting a very weird exception when trying to deploy my app on JBOSS
I am getting this error but only very occasionally. 99.9% of the time it
I'm getting a very weird answer when I'm trying to install ImageMagick through Homebrew.
I am getting a very weird error when using VBA in excel. I am
I am getting a weird exception when I exit the program. This has started
I've been debugging some app lately with valgrind, and I'm getting very weird reports
I'm getting a very weird issue with standard ASP.NET backend code, and the latest
Ok, this is very weird. I'm trying to do a database migration, and all

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.