Safari 10中的rotate3d错误。重叠内容

时间:2016-10-17 06:43:31

标签: css safari transform rotatetransform safari10

最后的safari 10给我带来了3d渲染的新痛苦。 在以前的版本中,它使用-webkit-transform进行修复:translate3d(0,0,0);但是不是现在。 示例(只是safari 10): https://jsfiddle.net/rhbs755c/4/ 代码:



var browserPrefix = "",
    usrAg = navigator.userAgent,
    thisElement = $('.main-slider__text-bg');

$(window).mousemove(function (event) {
    var cx = Math.ceil(window.innerWidth / 2.0),
        cy = Math.ceil(window.innerHeight / 2.0),
        dx = event.pageX - cx,
        dy = event.pageY - cy,
        tiltx = (dy / cy),
        tilty = - (dx / cx),
        radius = Math.sqrt(Math.pow(tiltx, 2) + Math.pow(tilty, 2)),
        degree = (radius * 20);

        thisElement.css('transform', 'rotate3d(' + tiltx + ', ' + tilty + ', 0, ' + degree + 'deg)');
});

.main-slider__text-wrap { 
  position: relative;
  padding: 20px;
  max-width: 300px;
  margin: 50px auto;
  -webkit-transform: translate3d(0,0,0);
}
.main-slider__text-bg {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: pink;
  z-index: 0;
 }
 .main-slider__text {
   font-size: 14px;
   color: #000;
   position: relative;
   z-index: 1;
   -webkit-transform: translate3d(0,0,0);
 }

<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<div class="main-slider__text-wrap">
    <span class="main-slider__text-bg"></span>
    <p class="main-slider__text">Lorem ipsum dolor sit amet, consectetur adipisicing elit. Iure, laborum non soluta natus quidem deleniti vel aliquam at assumenda, labore eum sed. Mollitia voluptatem porro quia. Quasi numquam, eaque distinctio.</p>
</div>
&#13;
&#13;
&#13;

有人知道,如何解决?

0 个答案:

没有答案