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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T22:34:09+00:00 2026-05-25T22:34:09+00:00

My Working Menu (with a minor problem)… I have a sliding drawer menu system

  • 0

My Working Menu (with a minor problem)…

I have a sliding drawer menu system I’ve been using successfully for quite a while. It uses rollover images and this working jsFiddle (#1) below nicely demonstrates just the relevant operation with static div‘s in place of the image rollovers.

My system uses container div‘s with overflow:hidden; and drawer div‘s inside each. When a jQuery animation slides the drawer outside the container it’s automatically hidden. Various other techniques are used to stop the animation when you move your mouse from the drawer back to the menu in order to prevent the drawer from closing prematurely.

Lots of time and effort was put into this system thanks to the help of the SO community. It served me well but now the menu drawers contain a lot more content. The larger/longer drawers have revealed this new issue as I’ll describe below.

Just for demonstration purposes, I’ve outlined the containers to show their positions and slowed the animation. The final project is faster and does not have these outlines.

#1 – http://jsfiddle.net/PayFw/143/

As you can see, when content (a link for example) requiring interaction is behind or partially blocked by these containers, the link is not clickable as it’s being covered. This problem can be seen in Mozilla and Webkit but not IE-8. (In this case, I think IE it not working as expected.) I have not tested other versions.

Playing with z-index is not a solution because that only causes the drawers to slide behind the content. Obviously, I want the drawers to slide over the content while in use.


What I’ve been trying…

Various solutions to the small issue above only seems to lead to more complicated issues.

I thought this one would be simple… just change make the containers invisible with visibility:hidden;. Then when you hover to invoke the sliding drawer, change to visibility:visible; and back to visibility:hidden; after the drawer closes. Even with the added complication of the animation, this is done with a callback to allow the closing animation to complete before making the container invisible again.

It’s working very good when you enter the menu item “cleanly” (“cleanly” defined: from the top/bottom while not touching adjacent menu items).

However, this solution has created a whole new problem. When you move from one menu item to another, the jQuery animation stop() interferes with the opening of the next menu and slams it shut while you’re still hovering it. And it’s making the callback function unreliable…. sometimes, as you can see via the gray outline, leaves the container visible, defeating the whole purpose of this solution.

#2 – http://jsfiddle.net/PayFw/144/


Questions:

  1. Is there another way to prevent system #1 from always blocking content even when the drawers are closed?

  2. If not, is there a way to fix the problems with version #2? i.e. – get the container’s visibility to properly toggle with the drawer animation while maintaining the same clean/reliable operation as in version #1.

  3. If there is no simple or practical solution, is there a jQuery plugin that can be easily integrated with my system? If so, which one and how? I know there are tons of jQuery menu drawer systems but I need something that can just put customizable sliding drawers under my already existing image rollovers (while not blocking the click-ability of any content that might fall into the drawers’ zone of operation).


EDIT:

Regarding answer posted by vzwick: His solution is simple and brilliant but it needs further explanation. His statement about using display:none; & display:block; in place of visibility:hidden; & visibility:visible; is only part of the story.

I was using visibility:hidden; on the containers.

Instead, I should have been using display:none; on the drawers.

Why?

By toggling visibility:hidden;, the container stays within the content flow. The containers are within the flow and have an automatic size that is determined by the drawer size.

By toggling display:none;, the drawer is removed from the content flow. By removing the drawer from the flow, its container becomes zero size. So although the containers are still in the content flow, they are collapsed, zero size, no longer interfering with the page’s content and therefore no longer a need to make them invisible.

http://jsfiddle.net/PayFw/146/

Brilliant. Thanks to vzwick.

  • 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-05-25T22:34:11+00:00Added an answer on May 25, 2026 at 10:34 pm

    Your problem is easily fixed by using display:block and display:none respectively:

    $('div[id|="m"]').each(function (i) {
    
        $(this).hover(enter, leave);
    
        $ht[i] = ($('#menu-'+i).height());
        $('#menu-'+i).css({
            'top': '-'+$ht[i]+'px',
            'display': 'none' // <--- changed
        });
    
    });
    
    function enter() { 
         j = $(this).attr('id').replace(/m-/, "");
         $('#menu-'+j).data({closing: false}).stop(true, false).animate({top: '0'},800).css({'display' : 'block'}); // <--- changed
    };
    
    function leave() { 
         $('#menu-'+j).data({closing: true}).delay(100).animate({top: '-'+$ht[j]+'px'},800, function(){ $(this).css({'display' : 'none'}) }); // <--- changed
    };
    

    See this fiddle for a working example.

    Edit:

    For clarification:

    Setting the visibility property to hidden is basically just another way of saying opacity:0. The element still retains its dimensions and position in the box model. In your case, this means that it overlays other content.

    The display property, in contrast, when set to none, removes the element from the box model/flow entirely.

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

Sidebar

Related Questions

I have a small problem when im working with a menu and a list
I have been working with Qt and Visual Studios 2008 for a while now.
I have a simple accordion menu working using jQuery but I'm having trouble styling
I'm working on this menu for a intranet system. I have a menu system
I have a menu working fairly well but can't figure out how to make
I'm working on a menu system where I want a ul to show as
The site I'm working on is using a Databound asp:Menu control. When sending 1
I'm working on a menu system that takes a url and then queries the
I have mega menu working and now I want to get all those h3
I have an accordion menu working on the page, but when I click one

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.