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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T21:41:25+00:00 2026-06-09T21:41:25+00:00

I have created a jQuery UI navigation menu, using the menubar widget. It works

  • 0

I have created a jQuery UI navigation menu, using the menubar widget. It works how I expected except I would like it to behave slightly differently. As you can see here http://jsfiddle.net/hcharge/DebVr/ the submenu expands out and is positioned relative to the link that was clicked.

I would like it to expand out and stick to the left of the navigation bar, no matter which link was clicked, the submenu will always stay the same width. Like this image…

enter image description here

I’ve tried setting a position relative to the container and absolutely positioning the submenu, however I think that jQuery UI positioning is overriding this. Any advice would be great, cheers.

Edit: this needs to be done with JS as it has to be clicks and not hover actions that trigger the dropdowns

  • 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-09T21:41:26+00:00Added an answer on June 9, 2026 at 9:41 pm

    Why don’t you do it all only with CSS?

    See http://jsfiddle.net/DebVr/8/

    Note: the background is blue in order to see the white borders.

    Edit:

    If you want some functionality, you can add it later, but I think that the basis should be with CSS.

    See my code with some functionality here: http://jsfiddle.net/DebVr/11/

    var links=$('#bar1>li>a').each(function(index,obj) {
      obj.tabindex=index+1;
    });
    $('#bar1>li>a').focus(
        function(){$(this).siblings('ul').show();}
    );
    $('#bar1>li>a').blur(
        function(){$('#bar1>li>ul').hide();}
    );
    

    Edit 2:

    If you want to hide again the submenu when clicked, use the following code:

    var links=$('#bar1>li>a').each(function(index,obj) {
      obj.tabIndex=index+1;
    });
    $('#bar1>li>a').focus(function(){
        $(this).siblings('ul').addClass('show');
    });
    $('#bar1>li>a').mousedown(function(){
        $(this).siblings('ul').toggleClass('show');
    });
    
    $('#bar1>li>a').blur(function(){
       $(this).siblings('ul').removeClass('show');
    });
    

    And CSS:

    #bar1>li>ul.show{
        display:block;
    }
    

    See it here: http://jsfiddle.net/DebVr/16/

    Edit 3:

    In the code above, I replaced obj.tabindex with obj.tabIndex, and updated the jsfiddle.

    The problem is that if you click on the submenu, the anchor loses focus and then the submenu dissapears. On Chrome it can be easily fixed setting the focus event to #bar1>li instead of #bar1>li>a, but then the event doesn’t work on firefox… I’m working on a solution, but meanwhile you can use http://jsfiddle.net/DebVr/16/.

    Edit 4:

    Finally, the fixed code: http://jsfiddle.net/DebVr/18/

    It works on Chrome, Firefox and IE.

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

Sidebar

Related Questions

I have created a jquery plugin to expand/collapse ul,li something like a accordion menu
I have created a navigation menu where, when clicking on a link, a jquery
I have this jQuery ajax navigation tabs plugin that I created using some help
https://i.stack.imgur.com/OP0kc.jpg the navigation menu i have created using the CSS and Html code is
I am using the jQuery Tools Scrollable plugin - http://flowplayer.org/tools/scrollable.html#navigator I have created a
I have created custom jQuery UI widget called uiPopover, very similar to UI-dialog (in
I have created tabs by using jQuery API and have bound one event handler
I have created a reiszable box using jQuery UI and I then pass the
I have a jquery treeview as navigation for a website. I am using the
I am having trouble with a navigation menu I have created. Basically, the navigation

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.