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

  • Home
  • SEARCH
  • 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 9150377
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T11:36:13+00:00 2026-06-17T11:36:13+00:00

I need a little advice regarding my problem with my vertical menu. My problem

  • 0

I need a little advice regarding my problem with my vertical menu.

My problem is now that when I click a Button my other Buttons are moved a pixel down and then straight back up again. Just looks rooten. For example click on “Michael”, “Jones”, “Kuwait” our “Superman”. You will see a small shift towards the bottom of the screen and then it resets itself to its original position.

var accordion_head = $('.accordion > li > a'),  
accordion_body = $('.accordion li > .sub-menu');
accordion_head.on('click', function (event) {
    if ($(this).attr('class') != 'active') {
        accordion_body.slideUp('normal');
        $(this).next().stop(true, true).slideToggle('normal');
        accordion_head.removeClass('active');
        $(this).addClass('active');
    }
});

You can find it here: http://jsfiddle.net/RTcf3/

How can this be fixed? Help is appreciated.

Thanks a lot and have a great weekend

TD.

  • 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-17T11:36:14+00:00Added an answer on June 17, 2026 at 11:36 am

    Edit: I would change your code a bit and make it check if the current menu actually has a submenu so it won’t try to show a ul that is empty (in case you’ll have some menus with submenus, and others without submenus). Let me know if you need help to do that.

    Here’s what I have on this fiddle:

    $('.accordion > li').on('click', function (evt) {
        var accordion_body = $('.sub-menu', this);
        if($(this).hasClass('active')) {
    
        } else {
            $('.active .sub-menu').slideUp();
            $('.active').removeClass('active');
            $(this).addClass('active');
            if(accordion_body.is(':empty')){
    
            } else {
                accordion_body.slideDown('normal');
            }
        }   
    });
    

    I also did a small change on your CSS. You have an anchor link displaying: relative. It makes no sense at all since it will never have a child tag.

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

Sidebar

Related Questions

I need a little advice. I've got windows service that runs at night. In
I have a little problem with my macrocode, and need your advice. Here my
I've never done that before and simply need a little advice how to do
Need a little help with my jquery here I want all my button with
I just need a little advice on what may be the best method for
I need a little piece of advice. I have a test page with 2
I have a little problem. I need to do some little operations on quite
I need a little advice on nesting HTML elements. I have a general structure
Here is a little problem that cannot be resolved by me such a Linux
I need some advice on a little project im doing. I have a database

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.