Unexpected behaviors noticed with Internet Explorer 11's translateY transition

I've encountered an issue where I am attempting to move an element from top to bottom (0 to 100vh), but Internet Explorer 11 seems to be behaving strangely when transitioning the transform property. Instead of moving down as expected, it is going up and not following the specified duration.

Check out JSFIDDLE1 for more information

Or visit JSFIDDLE2 here

div{
    width:200px;
    height:200px;
    background:black;
    transition:transform 5s;
    -ms-transition: -ms-transform 5s;
}

div:hover{
    transform:translateY(100vh);
    -ms-transform:translateY(100vh);
}

Can anyone explain why this unexpected behavior is happening in IE 11, and provide suggestions for resolving it?

Answer №1

Although this question was asked a while ago, I encountered the same issue recently. I am working on a slideshow that utilizes CSS transitions for slide animations. Most browsers work well with transform: translateX(-100vw) and transform: translateY(-100vh) to move slides left and up, respectively. However, Internet Explorer struggles to correctly calculate start/end positions and experiences timing issues as mentioned by @Alvaro.

To address this challenge, I opted to use absolute units (e.g., pixels) instead of relative values. Given the diverse range of screen sizes I have to accommodate, a single value won't suffice for me.

My solution involved employing a series of @media queries to establish a set of translation rules that ensure the slide consistently moves off-screen without going too far. Here is an example:

/* Slide left */
@media (max-width: 480px) {
  .slide.left {
    transform: translateX(-480px);
  }
}
@media (min-width: 481px) and (max-width: 960px) {
  .slide.left {
    transform: translateX(-960px);
  }
}
@media (min-width: 961px) and (max-width: 1920px) {
  .slide.left {
    transform: translateX(-1920px);
  }
}
@media (min-width: 1921px) and (max-width: 3840px) {
  .slide.left {
    transform: translateX(-3840px);
  }
}
@media (min-width: 3841px) {
  .slide.left {
    transform: translateX(-7680px);
  }
}

/* Slide up */
@media (max-height: 480px) {
  .slide.up {
    transforom: translateX(-480px);
  }
}
/* Additional queries can be added as needed */

These queries can cater to resolutions up to 8K, although the granularity may decrease at higher resolutions. Make sure to adjust them according to your specific requirements.

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

Stacked list using IE7 browser compatibility

Currently, I am facing an issue with IE7 where the list appears at the top of the submenu. Is there any solution to bring it back to its intended position? Surprisingly, this problem does not occur in IE8 or higher versions. I would greatly appreciate it i ...

Javascript animation functioning for a singular item within a list

As I continue practicing my skills in Javascript and HTML, I stumbled upon this intriguing list known as "item/adapter", similar to what we refer to as adapters in Android. While the process of adding them programmatically to my div is working smoothly, I& ...

What is causing the redirect to continue even after calling preventDefault() during form submission?

I've been struggling to figure out why my form submission using jQuery keeps redirecting after I submit it. Can anyone help me find the mistake in my code? Here is a simplified version of my form: <form action="http://xxxxxxx" method="post" id="m ...

Aspect ratio of images becomes distorted when setting them to occupy 100% height/width of the container

Check out my current style: .album-photos-container { position: relative; display: flex; flex-flow: wrap; justify-content: center; .image-card-small { width: 48%; margin: 4px; filter: brightness(0.8); img { width: 100%; ...

CSS KeyFrame animations

My goal is to have my elements gracefully fade in with 2 lines extending out of a circle, one to the left and one to the right. However, I am struggling to achieve this. Every time I attempt to display the lines, it ends up shrinking the entire design. M ...

Arranging divs with CSS positioning

I struggle with positioning divs, especially in this particular situation. I am attempting to position boxes in the following layout: _ ___ _ |_|| ||_| _ | | |_||___| Is there a way to avoid manually defining pixel positions for each box and ins ...

Switch out one picture for another by hovering over it

Looking for a way to replace the holder-01-small.png image with one of the same dimensions on hover without altering the HTML code. Here is the code snippet: <div class="mix category-1"> <a href="img/holder-01-large.png" class="photo"> <i ...

Update the class of the panel immediately prior to a click event

Is it possible to change the class before the animation starts or when opening/closing the panel? Currently, the class only changes after the animation has finished and the panel is already open or closed. Here is an example: http://jsfiddle.net/0b9jppve/ ...

Applying a unique style to an element using its ID is effective, but using a class does

Incorporating twitter bootstrap tables has been a focus of mine lately, particularly when it comes to custom styling such as setting background colors for table elements. Here's what I've discovered: by assigning id="foo" to each <td> elem ...

Create HTML content that dynamically changes based on the user's selection inputs

I am developing an HTML page where multiple geometrical figures are drawn on a canvas based on dynamic user input selection. <select id="mySelect" name="Geometrical Figures"><option>Triangle</option> <select id="cood1" name="Coordin ...

Search for every div element and locate the ul element within it. Calculate the total number of table rows present in the ul element. Add this

There is a list on my website with a sublist called .cart-items. This sublist contains a table with multiple rows. My goal is to iterate through each .cart-select item and count the number of tr elements within the cart-items. The count should then be disp ...

Tips for restricting the width of Arabic paragraphs in text

I need assistance with aligning an Arabic paragraph to end in the same virtual place, similar to how it would be in English. For example: hi how are you good morning ev Something like this - any help with that? ...

Is there a way to determine using code whether or not an iframe will be blocked by a website?

I'm creating a script that dynamically generates multiple iframes loading random websites. I am curious if there is a way to check programmatically if a website blocks being iframed, so I can display a thumbnail of the site as an alternative. Can this ...

creating a custom Django template filter that takes a variable as an argument

Utilizing a custom Django template filter, I have set up a mechanism to access elements in a 3D array within my template. The 3D array, swipeData, is passed from views.py to index.html. In index.html: function getNearestHalfHourTimeString() { var now ...

I am looking to upload a text file into a Javascript program in order to display the data from the file in a table format

As I venture into the world of programming, a new assignment has come my way. I have been given this txt file: nombre="Mario"; apellido="Atencio"; cedula="8-782-2289"; telefono="233-7867"; correo="<a href="/c ...

Is there a rationale behind using intricate CSS classes such as page-left-column-container-box-element-header for technical purposes?

What is the reasoning behind using this specific CSS and HTML structure for styling web pages? <div class="page"> <div class="page-left-column"> <div class="page-left-column-container-box"> <div class="page-left-column-con ...

offsetWidth varies across different browsers

There seems to be a 1px difference in the value of element.offsetWidth between Firefox and Chrome. I have been researching this issue. I attempted to apply a CSS reset and moved the element further away from the screen borders (as older versions of IE wer ...

What can I do to stop my list items from dropping below the menu even when there isn't enough space?

I'm facing an issue with my menu and despite several attempts, I can't seem to resolve it. In Firefox, everything looks fine, but in other browsers, the last anchor tag inside my menu keeps collapsing underneath. I've tried various solutions ...

What is the best way to ensure that the content container's max-width for a split tier is the same as the width of a full-width tier?

My goal is to create a split tier on a webpage with a 60/40 layout. The size of this tier should be calculated based on the maximum width of the container above it. Using JavaScript and jQuery, I managed to derive the max-width value of the full-width-tier ...

Angular Material: Modifying Form Field Control - changing position of floating label

I have developed a custom form field control for Angular 8 that is compatible with Reactive Forms and Angular Material. This form control features a simplified rich-text editor with a header containing various buttons for user actions. Is there a way to r ...