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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T05:42:29+00:00 2026-05-26T05:42:29+00:00

var item = $(‘li > a’, $(MENU_ELEMENT)); item.focus(function(event){ $(this).siblings(‘ul’).css(‘display’, ‘block’); $(this).parents(‘ul > li >

  • 0
var item = $('li > a', $(MENU_ELEMENT));
    item.focus(function(event){
        $(this).siblings('ul').css('display', 'block');
        $(this).parents('ul > li > ul').css('display', 'block');
    });
    item.blur(function(event){ 
        $(this).siblings('ul').css('display', 'none');
        $(this).parents('ul > li > ul').css('display', 'none');
    });

Essentially, MENU_ELEMENT would be a ul > li style dropdown menu with the following hierarchy:
<ul><li><a>Menu Item</a><ul><li><a>Sub Item 1</a></li>...</ul></li>....</ul>

Everything’s pretty standard really. The idea is to make the menu accessible with the tab key. Works in Chrome perfectly: when a child element receives focus, it makes sure that the parents as well as any submenus display. When the child loses focus, everything goes away.

In FF, it behaves like it would if you just added a :focus selector to your CSS stylesheet – the top menu items work great, but as soon as you go into a menu, they collapse.

In IE it’s even weirder – you tab into a menu, then when you tab again, you’re reset to the previous position.

This isn’t really a jQuery issue, I’m sure – just the way the different browsers implement focus, blur and tab keys. What’s the solution?

Edit I should point out that if you remove the entire blur handler, all three browsers behave exactly the same way (the menus all pull down and you can tab through them, but they just don’t collapse after you tab out of them.)

  • 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-26T05:42:30+00:00Added an answer on May 26, 2026 at 5:42 am

    The issue has more to do with how the browsers cache the current activeElement and handle the tabindex, and WHEN each browser processes the onblur/onfocus between Tab presses. When you use display:none to hide elements, FF and IE remove the tabindex from the list of tabs altogether, whereas Chrome does not appear to. In FF and IE, once an item loses focus, and the jQuery above hides that item, the tabindex is screwed up and the activeElement goes back to being the BODY. Using negative margins instead of display:none avoids the issue

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

Sidebar

Related Questions

$(.item).each(function(){ var item_link = $(this).find(a).attr(href); $(this).prepend('<div class=img_url></div>'); var img_url = $('div.img_url', this); $.get(item_link, function(data)
private function editForm():void { var event:DepManagementEvent = new DepManagementEvent(Edit Page,true); for each(var item:Object in
$(body).click(function() { var item = <h1>You clicked on: # + $(this).attr('id'); $(.position).html(item); }); Why
I have the following JS code: var Item = function () { this.property =
I have this code... function a(options) { for (var item in options) { if
var list = []; $.getJSON(json.js, function(data) { $.each(data, function(i, item) { console.log(item.text); list.push(item.text); });
I have a label function like : private function formatDate (item:Object, column:DataGridColumn):String { var
foreach (var item in ((ModelBase)Model).Stylesheets) { %> <%=item.url %> <link rel=stylesheet type=text/css href=<%= Url.Content(item.url)%>
I have this code: foreach (var item in ListView1.Items) { ListView1.Items.Remove(item); ListView21.Items.Add(item); } the
I have this code <% foreach (var item in Model.List) { %> <tr> <td><%:

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.