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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T01:43:21+00:00 2026-06-17T01:43:21+00:00

Creating an accordion – on the slide – the elements underneath the element that

  • 0

Creating an accordion – on the slide – the elements underneath the element that is sliding seem to move down a px and then back up, creating a juddering effect.

$(document).ready(function() {

//Promos banners rotation and accordion
$(function(){
    var $accordionList = $('.accordion').find('li');
    var numberOfItems = $accordionList.length;
    var currentItem = 0;

    // Set first item to active
    $accordionList.eq(currentItem).addClass('active').find('.content').slideToggle(800, function() {});

    // Loops through promos
    var infiniateLoop = setInterval(function() {

        if(currentItem == numberOfItems - 1){
            currentItem = 0;
        }
        else {
            currentItem++;
        }

        // Remove active class, if is has it, and close content
        $accordionList.parent().find('li.active').removeClass('active')
            .find('.content').slideToggle(800, function() {
        });

        // Add active class and open content
        $accordionList.eq(currentItem).addClass('active').find('.content').slideToggle(800, function() {
        });

    }, 4000 );

    // Click to show promo
    $accordionList.on('click', function () {
        // Stop rotation
        clearInterval(infiniateLoop);

        var $accordionHead = $(this);

        // Remove active class, if is has it, and close content
        if($accordionHead.hasClass('active')) {
            // Do nothing
        }
        else {
            $accordionHead.parent().find('li.active').removeClass('active')
                .find('.content').slideToggle(800, function() {
            });

            // Add active class and open content
            $accordionHead.addClass('active').find('.content').slideToggle(800, function() {
            });
        };
    });
});

});

Fiddle here demonstrating the problem

I’ve seen some suggestions that you fix the height of the content div – but the site is responsive so that won’t work.

  • 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-17T01:43:22+00:00Added an answer on June 17, 2026 at 1:43 am

    Ya, I’ve had this problem before to. My favorite fix is to just make my own .slideToggle()

    div = $('div');
    height = div.height();
    width = div.width();
    
    $('div').click( function() {
      if ($(this).hasClass('hidden')) {
        $(this).animate({height: "0", width: "0"}, 200).hide().addClass('hidden');
      } else {
        $(this).animate({height: height, width: width}, 200).show().removeClass('hidden');
      }
    });
    

    You could even wrap it in a prototype function if you wanted to.

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

Sidebar

Related Questions

I am creating some sliding panels (accordion) and I want to slide the background
I am dynamically creating divs within a jquery accordion that are loaded with data
I'm creating an accordion for wordpress and I can't seem to figure what I
I was creating a simple accordion menu based on concept used in here http://jsfiddle.net/WMfsR/
Creating liquid layouts is an immense pain. Now, I totally understand that tables should
I have requirement of creating/splitting my div elements horizontally and vertically on click of
I am creating a Jquery accordion from the following HTML <div class=title><a href=javascript:void(0)>Title goes
I'm creating a web application which loads tabs using AJAX. My problem is that
I am creating a horizontal accordion timeline but am having issues with child div
While creating an android project if i say that the Build Target of my

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.