CSS Transition and Translate Glitch

Currently working on a website and encountering a bug as demonstrated in this example.

The issue I'm facing is with the footer behavior - it should move up on hover and return to its original position on mouse-out. However, if I move the mouse to where the footer moved after going up, it automatically goes back up without the smooth transition effect.

It's difficult to explain this in simpler terms, so if anyone understands the problem and knows how to fix it, I would greatly appreciate your help!

Here is the code snippet:

html, body{
    height: 100%;
}
.x{
    width:100%;
    min-height: 100%;
    background-color: #000;
    color: #FFF;
}
.y{
    background-color: #ABC;
    width: 100%;
    text-align: left;
    position: fixed;
    bottom:-50px;
    height: 100px;
    -webkit-transition: 1s ease-in;
    -moz-transition: 1s ease-in;
    -ms-transition: 1s ease-in;
    -o-transition: 1s ease-in;
    transition: 1s ease-in;
}
.y:hover{
    -webkit-transition: ease;
    -moz-transition: ease;
    -ms-transition: ease;
    -o-transition: ease;
    transition: ease;
    -webkit-transform: translate(0px,-100px);
    -moz-transform: translate(0px,-100px);
    -ms-transform: translate(0px,-100px);
    -o-transform: translate(0px,-100px);
    transform: translate(0px,-100px);
}
<body>
    <div class="x"> x
    </div>
    <div class="y"> y
    </div>
</body>

Answer №1

Make sure to include a transition timing when hovering

transition: 0.5s ease;

Check out the latest JSFiddle for reference;

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 select an element that is currently visible but hidden underneath another element?

I have developed a circular graphic using primarily HTML and CSS, with some JavaScript and JQuery functionalities incorporated for text curving and planned interactions in the future. However, I've encountered an issue where clicking on the upper rig ...

Activate only the content of the parent div in a duplicated list using Javascript

Exploring the world of JavaScript, I am focusing on mastering event listeners and node lists. However, I have hit a roadblock when it comes to the JavaScript syntax for a specific query. My goal is to extract the innerHTML of each button and display it in ...

What is causing the issue with this pseudo class selector not functioning properly?

I've been experimenting with the :after selector to create an inside-border effect in every div I hover over. However, I'm facing an issue where the ":after" pseudo-class doesn't seem to work. Any insights on why this selector isn't fun ...

What is the best method for removing a class with JavaScript?

I have a situation where I need to remove the "inactive" class from a div when it is clicked. I have tried various solutions, but none seem to work. Below is an example of my HTML code with multiple divs: <ul class="job-tile"> <li><div ...

The dropdown menu functions smoothly in Firefox, although it may be less consistent in Chrome

I am encountering an issue with my JavaScript drop down menu. It functions properly in Firefox (version 57), but in Chrome (version 62) the drop-down only appears after clicking elsewhere on the page before clicking on the menu icon or button. My code in ...

How come my initial heading isn't aligned in the middle like the subsequent one?

I am having trouble centering my title Learn About Us correctly, similar to the title What we do. It seems there is an issue with the alignment of the picture, and I'm not sure how to fix it. https://i.sstatic.net/grWdK.png I need help understanding ...

Looking for help with aligning an icon to the right side of my text

I'm struggling with aligning the icon to the right of the quantity. When I use float:right, it places the icon at the far right of the cell instead of next to the text. Is there a way to get it to be on the right side of the text but directly adjacent ...

Is it possible to update the minimum date message?

How can I customize the minimum date message in my code from "please select a value that is not earlier than 2018-10-02" to "please select a value that is not earlier than 02-10-2018". https://i.sstatic.net/NYaZO.png Is there any way to change the date ...

Adjust the size of a nested div within a bootstrap container

My dilemma arises when nesting a product slider div inside a bootstrap col-lg-x div, as illustrated below: https://i.sstatic.net/9tCVA.png The issue lies in the layout distortion that occurs within a div.row > div.col-lg-8 structure, where images are ...

Exploring Bootstrap 4: Creating list-inline elements for various screen sizes

Is there a way to align list items on top of each other for a breakpoint <=575px (xs), and align the items next to each other for a breakpoint >575px (sm) using Bootstrap display properties? I found some information on How to display a list inline u ...

Unable to apply custom border color to Material UI Select component in React

I have been experimenting with material-ui v5 to improve my skills. I am currently struggling to customize the default style of the mui Select component. My goal is to modify the color of the Select element when it is being hovered over or in a focused sta ...

Leverage the power of Web Components in Vue applications

Currently, I am attempting to reuse Web Components within a Vue Component. These Web Components utilize the template element for formatting output. However, when I insert them into the Vue Template, they are either removed from the DOM or compiled by Vue. ...

What is the quickest way to eliminate a significant portion of the DOM in IE efficiently?

Whenever a user clicks the refresh button, it is necessary for me to eliminate a table from the current page and then reload a new one via ajax, displaying the updated information. I have placed the ajax-loaded TABLE inside a DIV with a specific id. Upon ...

What is the method for scrolling left in HTML?

I'm in the process of creating a one-page website that includes standard sections like services, portfolio, contact, and blog. When users click on the navigation menu for 'services', 'portfolio', and 'contact', it smoothl ...

Achieving equal height for the englobing/parent div and the inner divs

To achieve a standard left, middle, and right column layout, it is necessary for me to enclose various inner divs of different heights within a surrounding/parent div. It is crucial that the parent div adjusts its height to match the tallest inner div, whi ...

How can Chinese characters be transformed into XML/HTML-style numerical entities and converted into Unicode UTF-8 encoding?

I have a situation where I need to change a text that contains both English words and Chinese characters into a format that includes XML/HTML-style numerical entities for the Chinese characters. Here's an example of the original text: Title: 目录. ...

Having trouble getting a div to slide to the left on hover and collapse on mouseout using Jquery?

Hey there! I need some assistance in completing this code snippet. I have a div with overflow:hidden and a margin-left of 82px. Inside it, there is a share link and a ul list containing three external links. When I hover over the share link, everything w ...

Adjust the width of the unordered list to match the width of its widest child element

I'm encountering a minor issue with displaying a ul element as I am just starting to learn CSS. My goal is to set the width of my ul to match the widest listitem it contains. Below is the HTML code I have used: <div id="sidebar"> <ul i ...

Styling CSS for circular buttons

I am a newcomer and feeling quite puzzled. When using a div tag with the same width and height along with border-radius: 50%, it always transforms into a circle. However, when attempting to create a circular button using the 'a' tag, it doesn&apo ...

Using multiple dropdown selectors in one template is leading to complications

Aiming to replicate this https://i.sstatic.net/u687v.jpg where the Select projects feature is a multi-select dropdown menu and Filter Results functions as a collapse button that, when toggled, reveals three more multi-select dropdown menus. The implementat ...