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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T17:50:28+00:00 2026-05-24T17:50:28+00:00

So this is a ‘bug’ I have been fighting with for several weeks already,

  • 0

So this is a ‘bug’ I have been fighting with for several weeks already, I finally came around and ask for help.

So, first, what I am trying to achieve is a dropdown menu. I haven’t code one yet so I thought just to get the experience I would try. What I made are several buttons:
Buttons

Afterwards I added an mouseenter event to all of them and retrieved the corresponding dropdown menu using the ‘for’ attribute as an indicator. I do it like this:

var dropdown = $('.menu_dropdown[for="'+$(this).attr("id")+'"]');

It works, it gets the right element. I then want to position it right under the button, but that fails. And I have no idea why. I use this code to position them:

dropdown.position({

                        my: "center top",
                        at: "center bottom",
                        of: $(this)

                    })

It gives me something like this:
Misplaced dropdown

It should have been right under “Fanfictions”, does anyone know why it does this? I checked the buttons all have the right size etc.. The dropdown menu has “position: relative” styled on it. I tried without, or with absolute, both didn’t work.

I use the google CDN jquery + jquery ui versions.

If you make the dropdown menu hide, it tends to go even further away afterwards.

Thank you for any hints or help!

  • 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-24T17:50:30+00:00Added an answer on May 24, 2026 at 5:50 pm

    I believe JavaScript shouldn’t used for positioning. I don’t know is it what you really want or not but I do the dropdowns with CSS like this (see fiddle), I hope it helps:

    HTML:

    <ul>
        <li><a href="#">Menu1</a><div class="dropdown"></div></li>
        <li><a href="#">Menu2</a><div class="dropdown"></div></li>
        <li><a href="#">Menu3</a><div class="dropdown"></div></li>
    </ul>
    

    CSS:

    li{float:left; position:relative;width:60px; height:20px;}
    .dropdown{position:absolute; width:300px; height:200px; display:none;}
    li:hover .dropdown{display:block;}
    

    For better user experience I use jQuery hoverintent that adds a delay to hover.

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

Sidebar

Related Questions

This has been driving me crazy for 2 days. I have been trying to
This is kinda oddball, but I was poking around with the GNU assembler today
This is a sort of trivial question but something I've been wondering about. In
this is dankogai's javascript deflate http://github.com/dankogai/js-deflate I can't inflate from c#,please help me
This is what I would like to do: I have assigned the following items:
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString
This is a bit of a long shot, but if anyone can figure it
This is starting to vex me. I recently decided to clear out my FTP,
This might seem like a stupid question I admit. But I'm in a small
This is a difficult and open-ended question I know, but I thought I'd throw

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.