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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T09:17:26+00:00 2026-06-15T09:17:26+00:00

I have an html5 page with a dropdown menu using mootools. It’s working if

  • 0

I have an html5 page with a dropdown menu using mootools. It’s working if I use the hide() and show() functions. But, I want the menu’s to slide in and out, like this:

var m        = e.getElement(".dropdown-menu, .sidebar-dropdown-menu");

if (e.hasClass('active')) {

    m.hide();
    e.removeClass('active');

} else {

    m.show();
    e.addClass('active');
}

Instead of hide and show I want slideIn and slideOut:

var m    = new Fx.Slide(e.getElement(".dropdown-menu, .sidebar-dropdown-menu"));
if (e.hasClass('active')) {

    m.slideOut();
    e.removeClass('active');

} else {

    m.slideIn();
    e.addClass('active');
}

Working example: http://jsfiddle.net/wzzeZ/

Not working: http://jsfiddle.net/37V53/1/

It’s not throwing errors; where do I look to fix it?

  • 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-15T09:17:26+00:00Added an answer on June 15, 2026 at 9:17 am

    There are a few things going on here.

    First of all, you’re not seeing any errors because there are none. If you litter the code with console.log() calls, they all run.

    It’s a style issue that’s preventing the menus from displaying.

    The FX.Slide Class in Mootools doesn’t seem to explicitly set the ‘display’ property of the element you’re sliding to block. You still need to call .show() for it to work.

    Next, if you check out the docs for FX.Slide, you’ll notice that it creates a wrapper element to do the slide effect (the container is needed for the height animation, overflow: hidden, etc.)

    Unfortunately that seems to be messing with the positioning of the menu, which is positioned relatively to its containing element – but the containing element has height and overflow: hidden styles which then hide the menu (not to mention, even if you could see it, it’s in the right place).

    To see what I’m talking about check out this updated Fiddle here: http://jsfiddle.net/37V53/2/

    If you run that in Firefox with Firebug, and you hover your cursor over the element that’s logged to the console, you’ll see Firebug’s blue hilight appearing where your element actually is being displayed – in the middle of the window, and hidden from view.

    This is a combination of assumptions made in the MooTools Classes you’re using working against each other; You’ll probably be better off writing your own (simple) slide-out script using FX.Tween rather than FX.Slide.

    I created a sample of how to do this based on the original Fiddle (that works) – http://jsfiddle.net/LkLgk/

    Trick is to show the element to the browser but not the user (by setting visibility: hidden before display: block, grab the height, set height to 1px, visibility back to visible, then tween the height to the previously detected value.

    Hope that points you in the right direction; remember, when in doubt, console.log everything!

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

Sidebar

Related Questions

I have an html page with a z indexed dropdown menu. I have this
I have a problem with getting dropdown menu to appear in Magento when using
On my page I have a dropdown menu with a list of countries, this
I have web page i want to add the drop down menu On Reference
I am using a CSS menu in a web page and I want to
I have just created an HTML5 page with a background image in the top
I have an HTML5 Canvas on my page along with two text input fields.
I have a bit of problem when trying to validate my page as HTML5.
I'm using jquery to animate a dropdown menu. The children of a menu-item are
Ok so i am using the following jquery dropdown menu. I found this code

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.