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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T05:05:30+00:00 2026-06-05T05:05:30+00:00

I have a navigation with dropdown menus that, on a computer browser, appears on

  • 0

I have a navigation with dropdown menus that, on a computer browser, appears on hover (CSS3/jQuery for the effect) and when hovered out, it disappear. Although, it also detects if the user is on an iPad/iPhone and if so, displays the dropdown only when the user clicks the menu item. So let’s say I have a “Services” navigation menu, on a computer the submenu of Services will appear on hover, and on mobile on click.

Although on the mobile, the menu doesn’t close unless the user clicks another menu item / link on the page. What I would like is for the menu to disappear when the user clicks elsewhere on the page or even better, when he scrolls down the page. (if there’s a better way, let me know)

So yeah, here’s my actual code (for the mobile)

$("#generale > li").click(function(){
    $('ul:first',this).css("display", "block");

    // Hover that needs to be changed 
    $("#generale > li").hover(function(){}, 
    function(){
        $('ul:first',this).fadeOut(200);
    }); 

}); 

Basically it stills checks the hover out, but that’s where I’d need a better solution since there’s no hover on mobile.

Thanks for the 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-06-05T05:05:31+00:00Added an answer on June 5, 2026 at 5:05 am

    If you use jq 1.7+ then try this DEMO HERE http://jsfiddle.net/SCN5T/3/

    $(function(){
        $(document).mousedown(function(){
             $('.dropdown .active').removeClass('active').children('ul').hide();
        })
        $('.dropdown').on('mousedown','.subMenu', function(e){
            e.stopPropagation();
            var elem = $(this);
            if(elem.is('.active')) {
                elem.children('ul').slideUp(150);
                elem.removeClass('active');
            } else {
                 $('.dropdown .active').removeClass('active').children('ul').hide();
                elem.addClass('active').children('ul').slideDown(150);
            }
        });
        $('.subMenu').on('mousedown','ul', function(e){
            e.stopPropagation();
            alert('menu item clicked');
        });       
    })
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to build a jquery dropdown menu, basically I have the left navigation
I have javascript dropdown menus using jquery css and ul li. When they drop
I have a navigation that uses jQuery and CSS to control image mouseover positioning
I'm trying to make a navigation dropdown with jQuery that looks like this: <ul
I have a dropdown navigation panel and below it a div with context. Before
I have a navigation bar that has two dropdowns (as nested ul's). I'm trying
I have navigation.html (static coded navigtaion ) file loaded on multiple pages, using jQuery
I have a web page with a CSS dropdown navigation menu. My issue is
I am having an issue with applying css styles to dropdown navigation menus within
I have a navigation bar with some nodes that have a drop down menu

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.