gpt4 book ai didi

javascript - 旋转css3动画后保留最终位置

转载 作者:太空宇宙 更新时间:2023-11-04 04:54:43 24 4
gpt4 key购买 nike

有没有办法让这个 css3 javascript 动画流畅细腻请看链接jsfiddle

下面给出了我使用的css动画

.pageanim
{
/* Safari and Chrome */
-webkit-animation:nextpage 1s;
-webkit-animation-timing-function:linear;
-webkit-transform-origin: left;
-webkit-transform-style: preserve-3d;


}
.hideface
{
backface-visibility:hidden;
-webkit-backface-visibility:hidden;

}
@-webkit-keyframes nextpage /*Safari and Chrome*/
{
from {-webkit-transform:rotatey(0deg); }
to {-webkit-transform:rotatey(-180deg);
}

}


.revpageanim
{
/* Safari and Chrome */
-webkit-animation:prepage 1s;
-webkit-animation-timing-function:linear;
-webkit-transform-origin: 100% 0% 0px;

}

@-webkit-keyframes prepage
{
from {-webkit-transform:rotatey(0deg);}
to {-webkit-transform:rotatey(90deg);}

}

最佳答案

通过添加animation-fill-mode属性,可以选择动画结束时应该保留的是动画的第一帧还是最后一帧:

animation-fill-mode: forwards;

https://developer.mozilla.org/en-US/docs/CSS/animation-fill-mode

关于javascript - 旋转css3动画后保留最终位置,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12706375/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com