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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T01:51:06+00:00 2026-05-23T01:51:06+00:00

Hihi, I am trying to create a slide down menu using DIV, but hit

  • 0

Hihi, I am trying to create a slide down menu using DIV, but hit a problem that I can’t really figure out how to overcome. Let’s take a look at the code below:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> 
<head> 
    <title>test</title> 
    <script src="Scripts/jquery-1.4.1.js" type="text/javascript"></script>

    <script type="text/javascript">
        $(document).ready(function () {
            $("#menu").click(function () {
                $('#menuItem').slideDown('slow');
            });
        });
    </script>
</head> 
<body> 
    <div style="width: 500px; margin: 0px auto; padding: 10px;">
        <div id="menuItem" style="border: 1px solid blue; position: relative; z-index: 10; float: right; display: none; cursor: pointer;">
            MenuItem1<br />
            MenuItem2<br />
            MenuItem3<br />
            MenuItem4<br />
            MenuItem5<br />
            MenuItem6<br />
            MenuItem7
        </div>
        <div id="menu" style="border: 1px solid blue; position: relative; z-index: 10; float: right; cursor: pointer;">
            My Menu
        </div>
    </div>

    <div style="margin: 50px 0px; padding: 0px; text-align: center;">
        <div style="width: 500px; margin: 0px auto; border: 1px solid red; padding: 10px; height: 500px;">
            <div style=" position: relative; z-index: 1; float: right;">Form Element</div>
        </div>
    </div>
</body>
</html>

All I want to achieve is to make my slide down menu stay on top of my form element div. Please advice how can this be done. Many thanks!

🙂

  • 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-23T01:51:07+00:00Added an answer on May 23, 2026 at 1:51 am

    Quick and dirty: I added an absolutely-positioned outer containing for the menu, and then applied top:40px to the content div to push it down to compensate for the height of the menu.

    <div style="position:absolute;width:100%;">
        <div style="width: 500px; margin: 0px auto; padding: 10px; ">
            <div id="menuItem" style="border: 1px solid blue; position: relative; z-index: 10; float: right;  display: none; cursor: pointer;">
                MenuItem1<br />
                MenuItem2<br />
                MenuItem3<br />
                MenuItem4<br />
                MenuItem5<br />
                MenuItem6<br />
                MenuItem7
            </div>
            <div id="menu" style="border: 1px solid blue; position: relative; z-index: 10; float: right; cursor: pointer;">
                My Menu
            </div>
        </div>
    </div>
    
        <div style="margin: 50px 0px; padding: 0px; text-align: center;  position:relative; top:40px; ">
            <div style="width: 500px; margin: 0px auto; border: 1px solid red; padding: 10px; height: 500px;">
                <div style=" clear:both;  z-index: 1; float: right;">Form Element</div>
            </div>
        </div>
    </body>
    </html>
    

    As I type this, dotty’s already answered before me with a pretty much identical approach. However, in the code above, the individual menu divs are properly floating next to each other as you want them to, as they do in the first code you posted in the question.

    There are probably some div and styling elements that are a little redundant there now.

    Edit: It does occur to me now that the operation of the menu in dotty’s code is actually probably how you intended for the menu to be.

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

Sidebar

Related Questions

<html> <head> <style> .100PercentHeight{ } </style> </style> <body> <div class='100PercentHeight'>hihi</div> </body> </html> How can
I'm trying to really delete changesets in a git repository. I'm using git reset
using ASP.NET MVC 2 I have a navigation menu inside my Master Page. In
I cant really formulate that better, so I'll go with an example instead: XML:
I'hv got a problem when I am using foreach in smarty, an array with
hihi i have a question that i want to ask about c# and window
I'm trying to use usort() and leverage a global variable inside its function scope,
So what I'm trying to do is replace a string keyword with <b>keyword</b> in
I know it's possible to match a word and then reverse the matches using
A while ago, I had noticed that when encoding a map name: value to

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.