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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T13:14:01+00:00 2026-06-06T13:14:01+00:00

I am working on a jQuery menu for my friend. The menu is done,

  • 0

I am working on a jQuery menu for my friend. The menu is done, the only problem is that the slide down is not fluid and I can’t find the problem here.

jQuery code:

$.fn.vmenu=function(settings)
{
    vMenu={
        init: function(elem) {
            $(elem).find('li').each(function(){
                var u=$(this).children('ul');
                if (u.length>0) {
                    $(this).addClass('has_child');
                }
                var a=$(this).children('a');
                if (a.hasClass('active')) {
                    $(this).addClass('active').parents('li').addClass('open');
                }
            });

            $(elem).find('ul').each(function(){
                var o=$(this).find('li.open');
                var a=$(this).find('a.active');
                if (o.length == 0 && a.length==0) {
                    $(this).css('display','none');
                }
            });

            $(elem).find('a').click(function(){
                return vMenu.click($(this));
            });
        },
        click: function(elem) {
            var l=$(elem).parent('li');
            var u=$(l).children('ul');

            if (u.length == 0) {
                return this.forward(elem);
            }

            if ($(l).hasClass('open')) {
                $(l).removeClass('open');
                $(l).find('ul').stop(true,true).slideUp(300);
                $(l).find('li').removeClass('open');
                if($(l).children('a').hasClass('open')) {
                    $(l).children('a').css({color:'#939393'});
                    $(l).children('a').removeClass('open');
                }
            } else {
                $(l).addClass('open');
                $(u).stop(true,true).slideDown(300);
                $(l).children('a').css({color:'#F37121'});
                $(l).children('a').addClass('open');
            }

            return false;
        },
        forward: function(elem) {
            return true;
        }
    }
    vMenu.init($(this));
}

$(document).ready(function(){
 $('#vmenu').vmenu();
});

CSS code:

/* ### partner box ### */
.partnerBox { padding-top: 52px; width: 253px; float: left; background: url('http://www.realbingo.nl/images/partner-top.png') left top no-repeat; }
.partnerBox .bottom { padding-bottom: 12px; float: left; background: url('http://www.realbingo.nl/images/paasbonus-bottom.png') left bottom no-repeat; }
.partnerBox .mid { padding: 0 20px 0 15px; width: 218px; float: left; background: url('http://www.realbingo.nl/images/paasbonus-mid.png') left top repeat-y; }
.partnerBox h3 { padding-left: 5px; margin-top: -36px; color: #fff; font-size: 20px; }
.partnerBox ul { padding: 0px 0 0 0; margin-bottom: -5px; overflow: hidden; width: 100%; }
.partnerBox li { padding-left: 5px; font-size: 13px; float: left; list-style: none; width: 208px; line-height: 39px; border-bottom: 0px; }
.partnerBox li a { padding-left: 9px; color: #939393; text-decoration: none; display: block; background: url('http://www.realbingo.nl/images/arrow1.png') left center no-repeat; }
.partnerBox li a:hover { color: #F37121 !important; }
#vmenu li { border-bottom: #ece3e3 solid 1px; }
#vmenu li > ul > li { border-bottom: 0px; height: 30px; line-height: 30px; margin-top: -8px;}
.text ul{ line-height: 18px; margin-bottom: 2px; }

HTML code:

<div class="partnerBox">
    <div class="bottom">
        <div class="mid">
            <h3>Linkpartners</h3>
            <ul id="vmenu">
                <li><a href="#">Bingo</a>
                    <ul>
                        <li><a href="#">Link 1</a></li>
                        <li><a href="#">Link 2</a></li>
                    </ul>
                </li>
                <li><a href="#">Roulette</a>
                    <ul>
                        <li><a href="#">Link 1</a></li>
                        <li><a href="#">Link 2</a></li>
                    </ul>
                </li>
                <li><a href="#">Poker</a>
                    <ul>
                        <li><a href="#">Link 1</a></li>
                        <li><a href="#">Link 2</a></li>
                    </ul>
                </li>
                <li class="text"><a href="#">Tekst</a>
                    <ul>
                        Dit is een lap tekst die door en door gaat tot het einde.. en verder... :D:D:D:D:D:D:D:D
                    </ul>
                </li>
            </ul>   
        </div>
    </div>
</div>

Any tips and/or ideas to make the code more efficient are very appreciated too.

  • 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-06T13:14:03+00:00Added an answer on June 6, 2026 at 1:14 pm

    If you’re talking about the slideDown jumping when it gets to the bottom of the reveal it is likely to be caused by the bottom margin on the “.text ul” CSS. jQuery can’t calculate the height including margins.

    If you’re talking about the slideDown content moving around during the animation, this is often related to the top padding of either the element you’re sliding or the first child element.

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

Sidebar

Related Questions

I have a working simple jquery drop-down menu . But problem is how can
I'm working on a jQuery drop-down menu that fades in when you hover on
I'm working on a menu that should slide down when I click on an
I am working on a mobile application that uses the jquery UI select menu
I am working on an animated jQuery menu using Spritely the problem I have
I'm working off some code for a drop-down menu I found here on stack
I am working on a JQuery menu that needs to expand and collapse. However,
In your experience, what is the simplest jQuery flyout menu plugin that does not
I'm working on writing a drop-down menu with jQuery and I have a question.
I'm working with Jquery in Drupal. I have sets of four blocks that all

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.