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

The Archive Base Latest Questions

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

Searhed a bit and couldn’t find it. I’m sitting with a issue here. on

  • 0

Searhed a bit and couldn’t find it.

I’m sitting with a issue here.
on http://cmctest.netserver11.net, i have 6 images wich has a toggle jquery function.
Problem is, that when i, toggle twice, the other one dissapears.
I tried the jquery hide function but it was regardless.

Only thing i need for this is, when you toggle the second, the first one will collapse.

jQuery(document).ready(function() {
jQuery(".content").hide();
//toggle the componenet with class msg_body
jQuery(".heading").click(function()
    {
jQuery(this).next(".content").slideToggle(500);
    });
});

Would be awesome if you could help!
Thanx

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

    You just need to hide all before slide down

    jQuery(document).ready(function() {
        jQuery(".content").hide(); // hide all
    
        //toggle the componenet with class msg_body
        jQuery(".heading img").click(function()
        {
            jQuery(".content").slideUp(500); // slide all up
            jQuery(this).next(".content").slideDown(500);
        });
    });
    

    There is no need to use slideToggle() for what you want to acomplish, don’t “ask” the user to click again to hide the text…

    by the way… you should use a <ul> instead a bunch of <div>‘s for your markup, something like:

    <ul id="content">
        <li class="item">
           <img src="/images/minified/closedcolored.png" alt="" />
           <div class="description">
              <h2>Acquisitie</h2>
              <p>Hoe scherp bent u als het gaat om het werven en houden van klanten?</p>
           </div>
        </li>
        ...
    </ul>
    

    then you can easily do:

    jQuery(document).ready(function() {
        jQuery(".description").hide(); // hide all
    
        //toggle the componenet with class msg_body
        jQuery(".item img").click(function()
        {
            jQuery(".description").slideUp(500); // slide all up
            jQuery(this).next().slideDown(500);
        });
    });
    

    I just forgot one little detail!

    inside the click method, replace what you have with:

    jQuery(".description").slideUp(500); // slide all up
    if(!jQuery(this).next().is(":visible")) // is visible already?
        jQuery(this).next().slideDown(500); // slide down
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i've searched a bit and i couldn't seem to find this question asked specifically
I've looked through the documentation, and searched quite a bit now, and couldn't find
I searched a bit, but couldn't find an answer to this (probably very simple)
I searched around a bit and couldn't find anything clear cut as to whether/how
I apologize if this is a duplicate question, I searched a bit and couldn't
I have searched a bit on google, but didn't really found an answer to
I've searched a bit and didn't see any similar question, so here goes. How
I have searched around a bit, and have not really found a professional type
I have searched this topic on google a bit and seen some best practices.
Sorry if this is a noob question, I searched quite a bit and couldn't

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.