Ensure the submenu remains visible even when the mouse is not hovering over the parent

I am having trouble accessing my submenu when I move the mouse away from the parent element.

Could you please test the link provided [username and password both set to vts ]

Lowering the resolution seems to resolve the issue for me.

My current screen resolution is 1920x1080.

This is a snippet of My CSS:

nav {
    /*background:#0099FF;*/
    background: none repeat scroll 0 0 #fafafa;
    border-bottom: 1px solid #7e7e7e;
    padding: 0 0 0 10px;
    min-height:10vh;
    position: absolute;
    right: 0;
    top: 0;
    width: 100%;
    z-index: 11;
}
nav ul {
    text-align: center;
    /*display: inline;*/
    list-style: none;
    /*20150113*/
    min-height:10vh;
    display: inline;
    list-style: none;
    width: 100%;
    float: left;
    margin-top: -2px;

}
nav ul ul {
    margin-left: 0% !important;
}
nav ul li {
    font: bold 12px/18px sans-serif;
    display: inline-block;
    position: relative;
    vertical-align: middle;
    -moz-appearance: none;
    text-align: center;
    -webkit-border-radius: 3px;
    -moz-border-radius: 3px;
    border-radius: 3px;
    font-size: 12px;
    font-family: arial, helvetica, sans-serif;
    text-decoration: none;
    display: inline-block;
    font-weight: bold;
    color: #262638;
    margin: 0px -1px;
    line-height:1;
    top:1vh;

}
ul#nav > li li {display: table-row;}
nav ul li a {
    margin: 5px 5px 0px 10px; /*20150113*/
    text-decoration: none;
    color: #262638;
    display: block;
}

nav ul li a:hover {
    text-decoration: none;
    margin: 5px 5px 0px 10px;
    color: #000000;
    display: block;
    font-size: 12px;
    font-family: arial, helvetica, sans-serif;
    text-decoration: none;
    display: inline-block;
    font-weight: bold;

}
nav ul li ul {
    display: none;
    width: 960px;
    position: fixed;
    left: 17%;
    top: 10vh;
    border-top: none;
    margin-top: 1pt;
    overflow: scroll;
    height: 32%;
    overflow-x: hidden;
    text-align: left;
    border-bottom:5px solid #cccccc;
    padding-bottom:10px;

}
nav ul li ul li {
    width: 33.333%;
    border-left: solid 1px #ccc;
    margin: 0 -3px;
    /*padding:0px 25.5px;*/
    background: #FAFAFA !important;
    border-radius: 0px;
    text-align: left;
}
nav ul li ul li a {
    font-family: 'Arial', Helvetica Neue, Helvetica, sans-serif !important;
    -webkit-font-smoothing: antialiased;
    font-size: 12px;
    text-decoration: none;
    color: #666;
    background: #fff;
    cursor: pointer;
    padding: 14px;

}
nav ul li ul li a:hover {
    text-decoration: none;
    color: #de4a4a;
    cursor: pointer;
    padding: 14px;
}
nav ul li ul li h5 {
    font-family: 'Arial', Helvetica Neue, Helvetica, sans-serif;
    -webkit-font-smoothing: antialiased;
    font-size: 16px;
    font-weight: normal;
    margin-bottom: 10px;
}
nav ul li ul li p {
    font-size: 12px;
    font-family: Arial, Helvetica, sans-serif;
    font-weight: normal;
    padding: 0 16px;
}
nav ul li:hover ul {
    display: block;
    background: #fff;
    width: 64.1%;
    border: 1px solid #ccc;
    position: fixed;
    left: 18%;
    border-top: none;
}

Answer №1

To handle this situation, you will need to write a script that controls both displaying the menu and determining when it should be hidden. Remember, CSS is not a programming language, so defining actions for events like mouse out on an element cannot be done solely with CSS.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Implementing a click event listener on an iframe that has been dynamically generated within another iframe

Below is the code I used to attach a click event to an iframe: $("#myframe").load(function() { $(this.contentWindow.document).on('click', function() { alert("It's working properly"); }); }) Everything seems to be working co ...

Creating a circular shape with a radius that can be adjusted

I'm trying to create an expanding bubble-like circle of various colors when clicked on a blank page. The circle should continue increasing in size each time it is clicked, only stopping when the mouse click is released. I am looking to use HTML, CSS, ...

Execute the Jquery 'each' function only after ensuring that the ajax process has successfully completed

How can I ensure that ajax runs in every loop of the selected checkbox without being ignored by 'jquery each'? Whether completed or not, the loop should continue. Apologies for any confusion. Below is an example of the code I've attempted: ...

Tips on avoiding the collapse of the right div when positioned under a left float in a full page layout

Trying out a full page layout for the first time, with a left div serving as a block style nav. #admin_nav { width: 230px; height: 100%; background-color: #f9f9f9; border-right: 1px solid #ddd; float: left; } The content is on the rig ...

Utilizing jQuery for toggling the visibility of a menu

I have created a code for a navigation page that I am currently developing for use on the Tumblr platform. The navigation setup involves using #navstart as the category of the navigation items and #navitem for individual items. Below is an example of how I ...

Set up a custom JavaScript function to automatically refresh a webpage

I am in the process of setting up a JavaScript function to refresh on a specific webpage. The website utilizes an overarching JS and CSS framework, but I desire this particular function to load in a unique manner. The JS function within the framework dyna ...

Tips on preventing navbar from shrinking in height while resizing the page

I am working on an app that is designed to resemble a desktop operating system. Currently, I have a navbar positioned at the bottom of the page, but when the height of the page is adjusted, the navbar shrinks too much and becomes difficult to use. I have ...

Executing a jQuery AJAX request for a second time

Upon hitting the submit button for the first time, the codes work successfully. However, upon hitting the button for the second time with correct email and password values, nothing happens and the user cannot log in. I have identified that the issue lies w ...

Conceal a specific DIV class when another class is visible

In my WordPress project, I am working on a customization where the add to cart button on the product page should remain hidden until the customer answers all the questions. The plugin I am using offers options for the customers to select, such as Step 1, S ...

Specifying the data type of the input being passed into a .css() function within a jQuery ID selector

Currently, I am facing an issue where I need to position an element below a fixed toolbar. The amount of top-padding required for this positioning varies based on the viewport width. To address this, I have created a formula that calculates the percentage ...

Upload Avatar Images Without Uploading the Entire Page

Exploring options for integrating an avatar image upload feature into my project. Interested in finding an AJAX/jQuery solution that facilitates seamless image uploading without the need to manually refresh the page post-upload. ...

The variable "$" cannot be found within the current context - encountering TypeScript and jQuery within a module

Whenever I attempt to utilize jQuery within a class or module, I encounter an error: /// <reference path="../jquery.d.ts" /> element: jQuery; // all is good elementou: $; // all is fine class buggers{ private element: jQuery; // The nam ...

employing the 'appendTo()' function within a child div nested inside a parent div

After hours of searching, I still haven't found a solution to my specific problem: This is the HTML code I have: <div id="list" style="display:none;"> <div id="insideList"> <!-- Some picture will go here --> </di ...

Material UI does not support the inline attribute for applying CSS properties

Trying to adjust the CSS for Material-UI When setting the width, everything works fine. However, when attempting to set display inline, an error occurs ---> "inline is not defined" Can anyone provide guidance on how to resolve this issue? Sharing my cod ...

"Enhance Your Website with jQuery's Dynamic Multi-Animation

I'm facing an issue with my website where, upon clicking the contact link in the navigation bar, a contact box slides down and the navigation bar moves below it. However, when the contact link is clicked again to hide the contact box, the navigation b ...

Looking to display or conceal a text box with a date picker based on the selection of a specific value from a drop-down menu

I have a dropdown with two options: Indian and Others. When I select Others, I want to display three textboxes - two with date pickers and one with a simple text input field. I have tried writing the following HTML code but I am unable to get the date pick ...

Tips for scrolling a div by using its child element

Within this div, there is an image and another div. The height of the image exceeds the height of its parent div, and the child div's position is fixed. Is it impossible to scroll the parent div when using the mousewheel on the child div? To debug ...

Swap out the current image for a different one

When a user clicks on different image or color options, I want to change the main image displayed. Below are the links to the alternative images: https://i.sstatic.net/DxJEb.jpg This is the HTML code: <div class="container"> <p class="img-main" ...

`Error occurring with React-router when refreshing nested pages causing CSS not to load`

Setting up a react-router for my first React webapp has been a bit tricky. It seems to be functioning properly except for the issue with CSS not loading on nested pages when they are refreshed. The CSS works fine for single level paths like /dashboard, bu ...

How to use jQuery to select an element by using 'this' on a button

I have a total of 5 divs, each containing 5 different texts. <div class="text"> <%= theComment.text %> </div> I am working with node.js, MongoDB, and Mongoose. In addition to the divs, I also have a button labeled EDIT with a cl ...