FIELD NOTE / 76

H5开发之CSS兼容性问题

Parker / 2023-02-08 / JS

H5开发之兼容性问题

animation: animation-delay Android&ios ios低版本15.4 不生效的问题
错误代码:

@mixin thingsPoolAnimate($deg: '1', $time: 4s) {
  @if $deg == 'reverse' {
    animation: beginRotateOuterReverse $time infinite;
  }
  @else {
    animation: beginRotateOuter $time infinite;
    animation-delay: 0.3s;
  }
}

在ios16+的版本上是正常的,15.4测试是不生效,整个动画都是不生效的;
解决方案: 将animation-delay: 0.3s直接写到类上,不要放在if;

.inner {
      animation-delay: 0.3s;
      @include thingsPoolAnimate;
    }