Z-Index Anomalies with Webkit Transform Translate3d
In a scenario where two absolutely positioned div elements with specified z-index values overlap, applying a translate3d webkit transform to animate them off and back onto the screen can disrupt their z-index ordering.
Explanation
When using translate3d, the elements enter a three-dimensional rendering plane, where z-index becomes irrelevant. The transform moves the elements along the z-axis, breaking the traditional 2D stacking order.
Solution
To restore the z-index ordering:
element.css({ 'transform-style': 'flat' });
Additional Notes
The above is the detailed content of Why Does `translate3d` Break Z-Index Ordering in Overlapping Absolutely Positioned Elements?. For more information, please follow other related articles on the PHP Chinese website!