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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T12:24:47+00:00 2026-06-13T12:24:47+00:00

I am building my first simple accordian type thing (without any net tuts), the

  • 0

I am building my first simple accordian type thing (without any net tuts), the js I have is this:

jQuery(document).ready(function($){

    $('#one').css("height", "25");
    $('#dtwo').css("height", "25"); 
    $('#three').css("height", "25");   
        $('#one').click(function() {
          if ($('#one').hasClass("extended")) {
            $('#one').animate({height: '25px'},500);
            $('#one').removeClass("extended");
            $('#a1').animate({opacity: '1'},500);
          } else {
            $('#one').animate({height: '120px'},500);
            $('#one').addClass("extended");
            $('#a1').animate({opacity: '0'},300);
          }
    });
});

Which works fine.

However you can click it like 200 times and it will do it 200 times, how can I prevent this?

  • 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-13T12:24:48+00:00Added an answer on June 13, 2026 at 12:24 pm

    If youre talking about the animation queuing up, you could use the stop() method. Something like this:

    $('#a1').stop(true).animate({opacity: '1'},500);
    

    Passing true as the first argument will clear the queue.

    clearQueue A Boolean indicating whether to remove queued animation as well. Defaults to false.

    If you are experiencing trobule with the animation stopping half way due to the clearQueue bool you can try using stop(true, true) instead.

    jumpToEnd A Boolean indicating whether to complete the current animation immediately. Defaults to false.

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

Sidebar

Related Questions

I'm building my first jquery mobile site and have run into a problem. When
I'm building my first autoconf managed package. However I can't find any simple examples
I'm building my first ever jQuery plugin (it's just a simple experiment). Here's what
Building my first webapp with jQuery Mobile - this will need to work with
I'm building a simple slideshow using jQuery. I have the basics down, but as
I'm building a simple code-first MVC 3 blog like application. My model has three
Building my first SL MVVM application (Silverlight4 RC) and have some issues i don't
I'm building my first ASP.NET MVC website, and I'm trying to figure out how
My question is pretty simple. I am building my first application with mongodb. Up
I am currently building my first Immediacy Plugin, and do not have access to

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.