当前位置: 首页> 娱乐> 明星 > 关键字排名优化公司_营销网站制作郑州_黄冈seo_网站建设与管理就业前景

关键字排名优化公司_营销网站制作郑州_黄冈seo_网站建设与管理就业前景

时间:2025/7/19 0:18:20来源:https://blog.csdn.net/weixin_42154189/article/details/142259962 浏览次数:0次
关键字排名优化公司_营销网站制作郑州_黄冈seo_网站建设与管理就业前景

发现问题

  • 在做一个悬浮动画效果时,测试人员提出一个问题。
  • 在 IOS 机型上,动画效果有掉帧不流畅的现象。在安卓机型没有问题。

问题代码

  • 想要的效果是:以随机角度出现,小幅度缩小淡入,向上飘动并放大最后淡出消失
.animationBox{width: 100px;height: 100px;position: absolute;top: 0;opacity: 1;transform: var(--rotateZ) scale(1.2);animation: animation 0.5s 1 linear forwards;
}
@keyframes animation {0% {top: 0;opacity: 0;transform: var(--rotateZ) scale(1.2);}30% {top: 0;opacity: 1;transform: var(--rotateZ) scale(1);}70% {top: -100px;opacity: 1;transform: var(--rotateZ) scale(1);}99% {top: -100px;opacity: 0;transform: var(--rotateZ) scale(1.6);}100% {top: -100px;opacity: 0;transform: var(--rotateZ) scale(1.6);display: none;visibility: hidden;}
}

解决思路

  • 参考了一个解答,IOS 机型的 animation 会对一部分属性会进行重绘,所以会有卡顿不流畅的效果。
  • 参考链接

重新编写

.animationBox{width: 100px;height: 100px;opacity: 1;transform: translateY(0) var(--rotateZ) scale(1.2);animation: animation 0.5s 1 linear forwards;
}
@keyframes animation {0% {opacity: 0;transform: translateY(0) var(--rotateZ) scale(1.2);}30% {opacity: 1;transform: translateY(0) var(--rotateZ) scale(1);}70% {opacity: 1;transform: translateY(-100%) var(--rotateZ) scale(1);}99% {opacity: 0;transform: translateY(-100%) var(--rotateZ) scale(1.6);}100% {opacity: 0;transform: translateY(-100%) var(--rotateZ) scale(1.6);display: none;visibility: hidden;}
}
  • 这段代码在多个 IOS 机型上测试后,没再复现出卡顿的问题。
关键字:关键字排名优化公司_营销网站制作郑州_黄冈seo_网站建设与管理就业前景

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com

责任编辑: