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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T07:05:50+00:00 2026-06-17T07:05:50+00:00

I am trying to create jquery slidetoggle effect on an unordered list. it toggles

  • 0

I am trying to create jquery slidetoggle effect on an unordered list.
it toggles on but then immediately slides back up. I am unable to figure out if it is my css or if it is my jquery. BTW i am unable to get this working with my jsfiddle for some reason so the jsfiddle is only a view of my css, html and jquery.
Here is the jquery I am using:

function accordionLoad() {

    $(".accordion-header").removeClass("expanded");
    $(".accordion-content").hide();

    $(".accordion-header").bind("click", function(){
        $(this).toggleClass("expanded");
        $(this).next(".accordion-content").slideToggle();
    })

    $(".expand-all").bind("click",function(){
        $(this).siblings(".accordion").find(".accordion-content").slideDown();
        $(this).siblings(".accordion").find(".accordion-header").addClass("expanded");
    })

    $(".collapse-all").bind("click",function(){
        $(this).siblings(".accordion").find(".accordion-content").slideUp();
        $(this).siblings(".accordion").find(".accordion-header").removeClass("expanded");
    })
}

$(document).ready(function(){
    accordionLoad();
});

and the html..

   <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled 1</title>
<meta name="Microsoft Theme" content="HDRDefault 1011, default" />

</head>
<body> 
<div class="container">
  <div class="expand-all">Expand All</div><div class="collapse-all">Collapse All</div>
  <UL class="accordion">
    <LI class="accordion-item">
      <DIV class="accordion-header">Question2</DIV>
      <DIV class="accordion-content">
        <DIV class="Externa">Answer2..Answer2..Answer2..Answer2..Answer2..Answer2..Answer2..</DIV>      
      </DIV>
    </LI>

    <LI class="accordion-item">
      <DIV class="accordion-header">Question12</DIV>
      <DIV class="accordion-content">
        <DIV class="Externa">Answer12..Answer12..Answer12..Answer12..Answer12..Answer12..Answer12..</DIV>      
      </DIV>
    </LI>  
  </UL>
  </div>  
</body>
</html>

Here is the jsfiddle:
http://jsfiddle.net/9CNeX/8/

  • 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-06-17T07:05:51+00:00Added an answer on June 17, 2026 at 7:05 am

    See this example…

    jsfiddle

    $('.accordion-header').on('click', function(e){
      $(this).next().slideToggle();
    });
    

    Greetings.

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

Sidebar

Related Questions

I'm trying to create a jquery fadeto type of effect in Javascript, but am
I am trying to create a slideToggle effect in JQuery. I have a div
I'm trying to create a simple slideToggle effect using jQuery, so that a user
I am learning JQuery and trying to create cycling text through images but I
I am trying to create a jQuery fadeIn fadeout effect for my page content
I'm trying to create a jQuery effect for this block . The idea is,
I'm trying to create a jQuery like architecture in my app but i could
I'm trying to create a sliding FAQ menu using jQuery, but I'm getting an
I'm trying to create jquery dialog, but there is no use :( here is
Trying to create collapsible / expandable divs using jQuery, but it's not working for

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.