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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T00:07:32+00:00 2026-06-03T00:07:32+00:00

I have a JS+CSS menu that works perfect on mouse hover, but I have

  • 0

I have a JS+CSS menu that works perfect on mouse hover, but I have to make it also work on click for touch devices.

The menu is something like this:

<div id="menucontainer">
  <ul id="jsddm">              
    <li class="topmenu"><a href="#">Main Menu</a>
      <ul style="visibility: hidden;">
          <li><a href="http://www.google.com">Google</a></li>
          <li><a href="http://www.apple.com">Apple</a></li>
          <li><a href="http://www.microsoft.com">Microsoft</a></li>
      </ul>
    </li>        
  </ul>
</div>

And the JS:

$(document).ready(function () {
    $('#jsddm > li').bind('mouseover', jsddm_open);
    $('#jsddm > li').bind('mouseout', jsddm_timer);

    // this work, but the submenus dont click
    $('.topmenu').bind('click', jsddm_open);
});

Tried different ways with no success

Working sample here:
http://jsfiddle.net/xjuZ4/

  • 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-03T00:07:33+00:00Added an answer on June 3, 2026 at 12:07 am

    Put the click handler on the <a> tag. By putting the click handler on the top level <li> tag, you are intercepting any clicks on the child <li> tags as clicking on a child <li> tag is also clicking on the parent <li> tag.

    You will want to add e.stopPropagation(); to your click handler on the <a> tag to stop the hover out from being triggered.

    You will also most likely want to use the JQuery method .parent() to find the <li> that the <a> lives in when the click method is triggered.

    Updated JSFiddle with multiple drop down menus.

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

Sidebar

Related Questions

I have a three level menu that works on :hover and uses only css.
I have a CSS <ul> <li> nested menu that works perfectly in IE 8
I've got a css-based horizontal drop down menu that works perfectly well, but I'm
I have some markup for a popup menu that works in firefox but not
I have designed a 2-Level CSS drop down menu. Everything works perfect except only
I have this CSS menu: http://jsfiddle.net/7JC8t/ If you hover your mouse over 'inostranstvo' you
I have created a menu in HTML and CSS that works in all the
I have a menu that works on large screens but when the browser size
I have a CSS-only menu (ie. no JS) that works great in all modern
I have a CSS dropdown menu that is functioning how I want it 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.