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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T12:10:29+00:00 2026-05-27T12:10:29+00:00

Fiddle here: http://jsfiddle.net/emJcx/1/ I have a drop down menu that is a simple show

  • 0

Fiddle here: http://jsfiddle.net/emJcx/1/

I have a drop down menu that is a simple show and hide on hover. I would like this dropdown menu to be accessible by using the tab keys as well. Using this code:

$("li.trigger a").focus(function(){ 
    $(this).parent().find('ul').show();
});

I have enabled the dropdown to show on the head link focus.

The blur gets a little more complex. I tried this:

$("li.trigger ul li:last-child a").blur(function(){ 
    $(this).parent().parent().hide();
});

But it only works with forward tabs, not back-tabs (shift-tabs).

I have also tried something like this:

$('li.trigger').has('a:focus').find('ul').toggle();

But naturally this does not work.

Any thoughts on how this could work.

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-27T12:10:30+00:00Added an answer on May 27, 2026 at 12:10 pm

    I have this working for you: http://jsfiddle.net/emJcx/24/

    It may not be the most optimal solution possible, but here is what I did:

    1. You were limiting your focus event to the class of trigger but one of your li tags did not have that class so I removed it for now. You might want to button this down a bit because at the moment it will run for every li on the page.
    2. I changed the code to hide all of the child ul tags prior to showing the one you are currently on. This way when you shift-tab back up to the parent menu items and move away from the parent of a given sub menu it will disappear.
    3. I removed your blur event because it would have caused an issue when shift-tabbing back off of the last item. The functionality remains the same because the additional hide actually takes care of this.

    The new code is simply:

    $("li a").focus(function(){
      $(this).parent().parent().find('ul').hide();
      $(this).parent().find('ul').show();
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Fiddle demo available here: http://jsfiddle.net/r9MCW/5/ The functionality Basically, I have a very simple table
I have the following fiddle here: http://jsfiddle.net/9jN8L/ The idea is that sidebar will be
I have created fiddle here: http://jsfiddle.net/ozzy/WEGMh/ How it should look is here: Issue is
Fiddle here: http://jsfiddle.net/csaltyj/3A78u/ I want the sub-sub nav menu to align with the top
Fiddle here: http://jsfiddle.net/F6nJu/ I have a colored box: <div id=colorblock></div> #colorblock { background:#3ff; width:
I have a fiddle here: http://jsfiddle.net/maniator/SZpkF/1/ The green box is supposed to move with
I have this fiddle here: http://jsfiddle.net/maniator/MUa7P/ In this example a user picks a certain
I am new in JQ. I have created this fiddle here: http://jsfiddle.net/SZ6mY/7/ All I
You can see the fiddle here: http://jsfiddle.net/easeS/4/ Here is the html/css I have: #main
I have created a fiddle here: http://jsfiddle.net/ozzy/paPRg/1/ Basically, I want to allow users 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.