Not possible to use CSS calc() with transform: translateX in IE
To sidestep the calc()
limitations with transform: translateX
in IE, use JavaScript for your calculations:
This approach circumvents the use of calc()
, resulting in transformations that even IE finds friendly.
Cross-Browser Harmony
When dealing with CSS, it's good to juggle a few strategies for maximum compatibility. You might consider using a combination of translateX
values as an effective alternative to calc()
:
In essence, stacking translateX results in smooth transitions and is more future-proof.
Smooth and Reliable: Testing
It's not unknown that IE10/11 can be a bit quirky. So, it's a good idea to validate your code on these versions to ensure smooth animations. If translateX
isn't working as expected, perhaps left
might save the day:
Keep in mind that using left
for animations can sometimes be choppier than using transform
.
Future-proofing your code
Supporting IE-specific prefixes never hurts:
Also, keep an eye on the performance across all browsers. Doing so will ensure your animations run as smoothly as a buttered otter.
Progressive Enhancement
Consider CSS Feature Queries to provide a baseline experience on IE while pushing the boat out on other browsers:
Basically, the above code is saying "If you support this, do that. If you don't, well, do this instead."
Was this article helpful?