The sliding animation of jQuery beneath the menu button is causing the rest of the buttons to move unexpectedly

I have been working on a menu and have successfully implemented it in Chrome and Safari. You can view the menu at .

However, I am facing issues with Firefox when it comes to the tooltip feature. Every time I hover over a button, the other buttons (which are divs inside list items) shift to the bottom of their parent list item. This behavior puzzles me as all the items should fit without affecting each other's position.

A LINK TO AN ILLUSTRATION OF THE MENU CAN BE FOUND IN THE COMMENT BOX (since I lack enough reputation points to post images)

The situation is slightly complicated by the fact that the buttons animate into the page, resulting in their relative positioning. But this shouldn't cause the issue.

I came across a solution on Stackoverflow that involved applying 'overflow: hidden' to the list item, but this may require altering my animation. Although I can sacrifice the animation for functionality, a solution that addresses both would be ideal! Thank you in advance.


Here is some CSS code (excluding certain lines for animation):

#wrap ol#menu{
margin-left: 0;
padding-left: 0;
width: 1000px;
height: 160px;
}

#wrap ol#menu li{
display: inline-block;
list-style-type: none;
width: 138px;
height: 160px;
background-image: url("/images/backgroundbutton.png");
background-repeat:no-repeat;
background-color: white;
cursor: pointer;
position: relative;
z-index: 0;
}

#wrap ol#menu li .button{
width: 138px;
height: 82px;
z-index: 2;
position: relative;
background-repeat:no-repeat;
}

ol#menu li:nth-child(7n+1) .button {
background-image: url("/images/button-1.png");
}

#wrap ol#menu li .tooltip{
background-image: url("/images/tooltip.png");
position: relative;
background-repeat:no-repeat;
top: -30px;
width: 138px;
height: 130px;
z-index: 1;
display: none;
}

Answer №1

By simply changing the CSS to make list items float, you can resolve the issue at hand.

In the rule #wrap ol#menu li, replace:

display: inline-block;

with:

float:left;

(While keeping display:inline-block is acceptable, it becomes unnecessary once the elements are floated)

Answer №2

Well, that certainly is quite unusual. Have you considered converting your list items into a series of divs instead?

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

Getting a 401 error when using the Companies House API with jQuery and ajax

I attempted to retrieve JSON data from the UK Companies House API but encountered a 401 error An error occurred: the server responded with a status of 401 (Unauthorized) I implemented jQuery with the ajax() method for this task, and here is a snippet o ...

Achieving precise column alignment in Bootstrap 4

After searching extensively on Google and various websites, I am still struggling to find a solution for vertically aligning columns to be centered. Many sources I found mention aligning horizontally, but none seem to address the issue of vertical alignmen ...

Strategies to postpone the reload of a JQuery window

What could be the issue? I can't figure out why this delay function is not working even though the code appears to be correct. window.location.reload(true).delay(800);//true= hard refresh ...

Extract the list of selected item Id's from the HTML table and transfer them to the Controller

I have a table in my ASP.NET MVC project that displays information about file types and IDs (which are hidden) to the user. When the user selects checkboxes and clicks on the "Send Request Mail" button, I need to retrieve the IDs of the selected rows and ...

difficulty with parsing JSON in jQuery when referencing an external file containing the same data

Looking for help with parsing a json file using jquery? Check out this working sample: http://jsfiddle.net/bw85zeea/ I'm encountering an issue when trying to load "data2" from an external file. The browser keeps complaining that it's an invalid ...

Unable to handle prepended <img> using Pixastic

I'm encountering a puzzling issue with my website's image display. Currently, I have implemented a jQuery script that successfully scans a folder to gather image sources and displays them as background images on the site. Everything works smooth ...

Customizing Carousel Arrows in Angular with ng-bootstrap

I need help changing the position and icon of control arrows using Bootstrap. I've tried targeting "carousel-control-prev-icon" & "carousel-control-next-icon", but nothing seems to work. Any suggestions on how to properly solve this issue? Here is th ...

Troubleshooting problems with populating select options using jQuery on click

After successfully creating a sample in jsfiddle http://jsfiddle.net/9vkk5/ to demonstrate my issue, I have managed to populate the select with data from a database using the following code: $.ajax({ type: "POST", url: "load.php?type=clients", ...

Jquery ajax success, no data returned despite successful call

I'm in urgent need of assistance. I've encountered an issue with my jQuery code, as I am trying to make an Ajax call to a JavaScript file that contains an array. The JavaScript file is named test-ajax.js var data = ["category", "Alarm"]; r ...

I am currently experiencing an issue where the list items bullets (<ul>) and numbers (<o>) are not displaying correctly on my webpage, even after using the overflow-x: hidden

I am facing a challenge with my web page where the list items are not displaying the usual dots and numbers next to them. Interestingly, when I remove the overflow-x: hidden; property in my CSS, the list item numbers and dots show up immediately, although ...

What could be causing the span tag to not have CSS applied and the background image to not be displaying

The header I have created, shown in the image, is facing two issues. Firstly, I am unable to add ellipsis to the span tag even though I used it. I want the ellipsis to appear when the screen resolution is small. Secondly, the image uploaded is not displayi ...

``Is there a way to position an image at the center in Python dash?

Can someone help me with centering an image in my Flask dash app? Here is the code I have: import dash from dash import html, dcc import dash_bootstrap_components as dbc app = dash.Dash(__name__) app.layout = html.Div([ dbc.CardImg(src=r'assets/ ...

switching back and forth between the registration and login forms

<script> $(document).ready(function(){ $("#register_link").click(function() { $("#login_or_register").empty(); $("#login_or_register").load("register_form.php"); }); $("#login_link").click(function() { $("# ...

Designing a form within a div container while ensuring that the content remains contained

I've been struggling to perfect this formatting for quite some time now. While I've come across many similar examples to what I'm aiming for, I just can't seem to get it right. My goal is to create a form that will "popup" using JS for ...

I am experiencing issues with the detection of mouseover events on an SVG circle

I am currently working on a d3 map with zoom functionality that displays circles representing different cities. However, I am facing an issue where the mouseover event for the circles (which shows tooltips and clicking reveals some lines) seems to only reg ...

The Typewriter Effect does not appear alongside the heading

For my portfolio website, I am using React to create a unique typewriter effect showcasing some of my hobbies. Currently, the code is set up like this: "I like to" [hobbies] However, I want it to display like this: "I like to" [h ...

JavaScript: what is the method to add a paragraph when the condition is not met?

I am currently working on a project that involves checking if a student is actively engaged in an online journal. This is done by tracking the student's progress using a unique userId. If the student's userId is not found in the JSON data returne ...

Designing a dynamic button with changing colors using html and css

Is there a way to design a button with a starting color of red, but changes to orange when the mouse hovers over it? I am looking to add this type of button to my website. ...

Ways to center a div within a solo component in Vue.js

.container { display: flex; justify-content: left; } .containertwo { display: flex; justify-content: right; } .center { text-align: center } <div class="container"> //component1 <div class="one">some content</div> </div&g ...

chosen problem concerning jquery

My objective is to transfer li elements from one container to another container when the user clicks on the li span. I have a choices container and a choices display, so when a user clicks on the li span with the id of "add" in the first container, the r ...