iOS Safari + CSS calc() + CSS transition = Instant Crash

前端 未结 7 1273
既然无缘
既然无缘 2020-12-25 12:07

When I try to use left: -webkit-calc(100% - 100px); (assuming that left: 0; is initial state) it works in iOS 6.0.1 just fine. But when I do the sa

7条回答
  •  误落风尘
    2020-12-25 12:36

    You can fix this by initialising the property with anything but auto:

    .menu {
      left: 0;
      transition: left 1s linear;
    }
    
    .menu-open .menu {
      left: -webkit-calc(100% - 50px);
      left: calc(100% - 50px);
    }
    

提交回复
热议问题