What causes the width of my ul elements with absolute positioning to fluctuate?

http://jsfiddle.net/seXjp/

As you hover over "one," "two," or "three," a menu will appear.

An issue arises during the animation where the right side seems to be cropped off by 10px.

However, once the animation is complete, those 10px magically reappear!

What could be causing this peculiar behavior?

Thank you for any insights!

Answer №1

There are some issues with the box model in your code.

To fix this, make sure that the width of .upmenu ul is set to 110px (100px + 2*5px padding of .upmenu li). Additionally, ensure that .upmenu ul li has no horizontal padding when using width: 100%.

For an updated version, check out this link

Edit:

Since you are using centered text, consider setting the horizontal padding to 0 for .upmenu li. This way, you can use either 100px or 100% width without any problems.

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

Guide to incorporating jQuery into an ASP.NET webpage and styling GridView column layouts

After reading numerous articles and questions on formatting gridview rows using jQuery, I decided to give it a try for the first time in an ASP.NET page. Although I managed to write the following code, it seems to have no effect on the gridview. Can anyon ...

Varied characteristics of pseudo-classes when used with or without spacing

There seems to be an issue related to CSS pseudo-classes, specifically :last-child, but it may apply to others as well. If we consider the following simple HTML: <body> <p>Paragraph1</p> <p>Paragraph2</p> </body ...

Prevent button from triggering within div when clicked

I've encountered a perplexing issue that has me stumped. Within a defined div, I have included a button. My goal is to have a function called when anything inside the div, excluding the button itself, is clicked. However, if the button is clicked, the ...

Is there a way to determine the number of clicks on something?

I'm attempting to track the number of times a click event occurs. What is the best method to achieve this? There are two elements present on the page and I need to monitor clicks on both of them. The pseudo-code I have in mind looks something like ...

Implementing a special class for the currently selected navigation item as a solution to the Bootstrap limitation

I'm currently developing a website using Bootstrap, and I want to add a custom style to active navigation items by creating a backdrop effect instead of just changing the text color. Initially, I started with white text color for testing purposes, bu ...

CSS3 Animation for Enrollment Progress Bar

https://i.sstatic.net/aYwHP.png How can I best incorporate this functionality? <div class="container"> <h2>Simple Progress Bar</h2> <div class="progress"> <div class="progress-bar" role="progressbar" aria-valuenow="70" ...

For Flexbox front end design, the left side should be contained within a container while the right side should seamlessly stretch across the

https://i.sstatic.net/3RYY6.png I'm facing a challenge in designing a website with a unique layout that has left me puzzled. I've created a codepen example to showcase what I'm trying to achieve. Specifically, I need to implement a Hero Ba ...

Increasing the height of list items

I'm currently working on creating a scale using list items, and I want the height of each item to increase incrementally. So far, I haven't been able to find a solution other than adding a class to each item. Here's a fiddle demonstrating t ...

Using JavaScript to iterate through user input and generate an array of objects

I am attempting to iterate over input elements inside a div in order to generate an array of objects. <div id="time"> <input type="text" name="from" placeholder="12:00 AM" /> <input type="text" name="to" placeholder="12:30 AM" /> & ...

I am curious as to how this function is aware of the specific attribute that is being passed

I've been experimenting with a little application that fetches a list of movies from an API. You input a word and it returns all movies with that word in the title. Here's the code responsible for fetching the list: var getMovies = function (que ...

Best practice for placing business logic following an $.ajax request

Initially, I had put all my sorcery within the success function, but then I discovered that one could add done(...) after the call (and supposedly there's a ready option too). Where should I place the most effective location for performing these magi ...

The mobile menu in bootstrap is stationary while the background scrolls instead of the menu

I recently completed a website using Bootstrap, and everything seems to be working well on desktop. However, I am facing an issue when loading the site on mobile devices. The menu is not scrolling properly when opened, making it difficult to view all the o ...

Center title with a subtitle beside it

https://i.sstatic.net/giiPr.jpg My goal is to replicate the typography shown above. The main title is centered, while the subtitle is positioned next to the title. I managed to achieve something similar below using Bootstrap's small class. https://i ...

What could be the reason behind these links not affecting the height of my div element?

I am having trouble with the links not changing the height of the "holder" element. I can't seem to figure out what is going wrong. HTML: <div id="holder"> <a class="button" href="#"><span>home</span></a> <a class="b ...

Is it possible to insert information from a DataTable into a database table without requiring a predefined structure in the database table beforehand?

Is there a way to create a database table directly from an Excel sheet without needing to have a fixed database structure beforehand? I've attempted using SQLBulkCopy and other methods, but they all require pre-defined table specifications. Is there a ...

Troubleshooting Vue.js and Laravel: Having trouble loading new image files, while the older ones load just fine

Currently, I am working on a project that involves Vue.js and Laravel. In this setup, Vue is located inside the resources/js directory of the Laravel project. My current issue revolves around loading an image from the resources/js/assets directory. While ...

Issue with jQuery DataTable displaying content from the beginning of its text is not visible

I have utilized a jQuery DataTable to exhibit the roster of employees in a store. The framework of the table is as follows: <table class="gridTableSummary hover pretty cell-border" id="summarytable" cellspacing="0"> <thead class="col-h ...

Sliding through various background options

How can I change backgrounds on a slider without using .style.backgroundImage? Is there a way to do it by adding a class to the slider or some other method? 'use strict' let backgroundSlides = ['url(\'/images/slider/burger-back ...

Incorporating html content into an MVC webpage using jQuery - is it

Let's discuss an interesting scenario. I have a webpage created in MVC. This webpage incorporates a helper function. <% Html.RenderPartial("foldingHelpBox", ViewData["foldingHelpBox"]); %> Now about the Action: public ActionResult Index( ...

What is the functionality of the HTML code in an AngularJS application that allows it to reveal hidden text on a webpage?

My goal is to extract text from a specific web element contained within an <input> tag in the following HTML. Although the webpage displays "A-1", the actual HTML code does not contain this text, as the developer has implemented dynamic display based ...