Ways to Turn Off CSS Vertical Menu Flyout Animation

I'm new to HTML Lists and trying to figure out how to disable the "Hover flyout effect" so that all sub items are listed vertically below the main item while remaining visible. Can someone please help me understand which specific CSS properties can be used to disable this effect?

Here is the fiddle https://jsfiddle.net/qbg6jw9p/

CSS

#prod_nav {
    position: relative;
    z-index: 300;
    border-left: 1px solid #d7d7d7;
    border-right: 1px solid #d7d7d7;
    border-bottom: 2px solid #d7d7d7;
}

#prod_nav li.top {
    display: block;
    float: left;
    width: 170px;
    border-top: 1px solid #d7d7d7;
    border-bottom: 1px solid #fbfbfb;
    height: 31px;
}

#prod_nav li a.top_link {
    font-size: 11px;
    display: block;
    width: 159px;
    padding-left: 11px;
    line-height: 31px;
    color: #252525;
    text-decoration: none;
    font-weight: bold;
    cursor:pointer;
    background: #f0f0f0;
}

#prod_nav li a.top_link span, #prod_nav li a.top_link span.down {
    display: block;
    padding-right: 20px;
    background: url(../images/productmenu-arrow.gif) no-repeat right center;
}

#prod_nav li:hover a.top_link {
    color:#0072bc;
    background: #fff;
}

#prod_nav li:hover a.top_link span, #prod_nav li:hover a.top_link span.down { background: url(../images/productmenu-arrow-hover.gif) no-repeat right center; }

/* Default list styling */

#prod_nav li:hover {
    position:relative;
    z-index:200;
}

#prod_nav li:hover ul.sub {
    left: 170px;
    top: -1px;
    background: #fff url(../images/productmenu-leftborder.gif) no-repeat left top;
    border: 1px solid #e2e2e2;
    border-left: 0;
    white-space: nowrap;
    width: 384px;
    height: auto;
    z-index: 300;
}

#prod_nav li:hover ul.sub li {
    display: block;
    position: relative;
    float: left;
    width: 364px;
    font-weight: normal;
    background: url(../images/productmenu-section-bg.png) no-repeat right bottom;
    padding: 10px 0 10px 20px;
}

#prod_nav ul, #prod_nav li:hover ul {
    position:absolute;
    left:-9999px;
    top:-9999px;
    width:0;
    height:0;
    margin:0;
    padding:0;
    list-style:none;
}

/* Overwrite the above settings */
#prod_nav li:hover ul.sub ul {
    position: relative;
    left: auto;
    top: auto;
    width: auto;
    height: auto;
    float: left;
    width: 152px;
    padding-right: 20px;
    background: none;
}

#prod_nav li:hover ul.sub ul li {
    background: none;
    padding: 8px 0;
    margin-right: 20px;
    width: 132px;
}

#prod_nav li:hover ul.sub ul li a {
    color: #363636;
    text-decoration: none;
    white-space: normal;
}

#prod_nav li:hover ul.sub li a:hover {
    color: #0072bc;
    text-decoration: underline;
}

#prod_nav li:hover li:hover a.fly, #prod_nav li:hover li:hover li:hover a.fly, #prod_nav li:hover li:hover li:hover li:hover a.fly, #prod_nav li:hover li:hover li:hover li:hover li:hover a.fly { 
    background: none;
}

Answer №1

To modify the positioning of the dropdown menu items, adjust the left and top properties for the ul.sub element. Currently, the menu is set to move 170px from the left and -1px (up 1 pixel) from the top when hovered over.

#prod_nav li:hover ul.sub {
    left: 0;
    top: 31px;
    background: #fff url(../images/productmenu-leftborder.gif) no-repeat left top;
    border: 1px solid #e2e2e2;
    border-left: 0;
    white-space: nowrap;
    width: 384px;
    height: auto;
    z-index: 300;
}

View Updated Fiddle Here

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

What is the best way to give a user the option to select the destination for file uploads?

I currently have a basic upload form set up. Here's the HTML code: <html> <head> <title>Upload a File</title> </head> <body> <font face=verdana size=2> <form enctype="multipart/form-data" method="post" act ...

Unable to pick out particular elements from the information stored in <?!=JSON.stringify(dataFromServerTemplate) ?>

I am facing an issue with the JSON format. Being new to this, I am struggling to identify the root of the problem. In my Google App Script, I have a doGet function that looks like this: function doGet() { var htmlTemplate = HtmlService.createTemplateF ...

The base64 code generated by the toDataURL method on the canvas appears to be incorrect

I am facing an issue with my code while using canvas to draw a cropped image with base 64. The problem is that it works perfectly on Chrome but gives me a blank image on Firefox. async function base64SquareCrop(imgbase64, size = 224) { const img = docume ...

I am looking to superimpose one rectangle over another rectangle

I am looking to create something similar using CSS and TypeScript/JavaScript: Could someone please guide me on how to achieve this? My attempt with a flex container looks like this: I am new to front-end development. Can anyone point out what I might be ...

Dynamic drop-down navigation with rearranging menu

I am attempting to design a drop-down navigation bar with 2 rows. Initially, only 1 row is visible. Upon clicking the visible row, both rows should appear. Subsequently, when one of the 2 rows is clicked, only that specific row should be displayed. Below a ...

I have been having trouble getting the entire background to display in a specific color with Styled Components

It seems like a simple issue, but I just can't get the background to cover the entire screen. Even though I have provided the code I used, only a quarter of the top of the screen appears black when wrapping something in the component. Here is the cod ...

Create a visually appealing Zoom Effect with CSS while ensuring the div size remains constant

Update: What should I do if the width size is unknown? Check out the demo on JS Fiddle If you visit the provided link, I am trying to achieve a zoom effect where only the image inside the div zooms, not the entire div itself. However, I seem to be missin ...

Angular: sending the user input to the component

I'm trying to link the value of an HTML input field to a variable 'numToAdd' in my component, and then increment the 'numToAdd' variable by 1. However, I'm facing difficulties passing the input value to the component variable. ...

Is the CSS and jQuery plugin combination blocking the AJAX call or event listener from functioning properly?

After finally getting superfish to work, I encountered a problem where an ajax call would not trigger due to the event listener being prevented. By commenting out the plugin initialization, the event fired but with incorrect data. Any insights on why this ...

Tips for customizing the WooCommerce product page

If you want to customize the layout of a WooCommerce product page, you can override the template by copying the WooCommerce template folder into your theme. You can find step-by-step instructions here. I am looking to change the layout of a WooCommerce pr ...

Utilizing identical CSS for both mobile and desktop interfaces, while customizing margins and paddings separately

I am facing a problem on my website where the padding and margins appear differently on different devices. I have compared screenshots of the site on an Android device and my desktop PC: Site displayed on mobile device: Desktop view: Below is the CSS co ...

Hiding elements in HTML with React when data is null

Is there a way to hide elements using classes like "d-none" when the data is null in React? <span className="product__tag">{prod.tag1}</span> <span className="product__tag">{prod.tag2}</span> <span classN ...

Include a <div> element to display the date in an HTML format, ensuring that the days and months

I am working on a project where I have a list of dates and I need to format them by adding div tags to separate the days, months, and years into different divisions. <div class="campaign">30/11/2016 - <a href="#" target="_blank">Dummy Text& ...

submit a new entry to add a record to the database

Hey there, I recently started learning PHP and JS and I'm trying to insert a row into a WordPress database table. I need to get the information needed for insertion from another table, but I'm facing an issue with the PHP file as it's not in ...

Version 1 of Vue.js is not compatible with Ajax-loaded HTML files

Currently, I am encountering a minor issue with loading content through ajax requests. I am in the process of developing a web application where everything is located on one page without any reloading. To achieve this, I have split the content into separa ...

Alert: The specified task "taskname" could not be located. To proceed with running grunt, consider using the --force option

My current task involves converting .css files to .sass files using the 'grunt-sass-convert' npm module. Here is the configuration in my 'Gruntfile.js': 'use strict'; module.exports = function(grunt){ grunt.loadNpmTasks( ...

Create an input field that limits the user to typing only three unique characters

How can I restrict the user to input only three characters in a text field? Specifically, I want to limit it to either 3, 6, or 9. ...

When toggling visibility with JS, the Bootstrap Grid Row may not center-align as expected

Sorry for the odd spacing issue that might occur. I currently have a basic Bootstrap Grid setup as follows: <div class="row justify-content-center" align="center" id="details"> <div class="col-sm-2"> ...

Breaking content into two sections using Javascript or jQuery

Uncertain if Javascript can handle this task, any assistance or advice is appreciated. Consider this scenario: Suppose I have a 6-paragraph long content (text only) being pulled dynamically from the database all at once. This means that all 6 paragraphs a ...

Which event listener in the DOM API should I use to trigger an action when a form field is focused, whether through a mouse click or by tabbing?

My aim is to increase the size of form fields when the cursor focuses on them, either through a mouse click or by tabbing using the keyboard. By utilizing document.activeElement focus, I can identify when the user clicks inside a text input or selects an ...