Webkit CSS 动画跳转问题



>我有一个动画设置,有两个旋转的盒子,一个大盒子里的小盒子。它使用 JS 添加类以动画、暂停和恢复。

在Webkit中,我遇到的问题是mouseout,它添加一个暂停类并暂停CSS动画,动画跳回到其初始状态。有时它会跳跃,就好像动画从未暂停过一样。我尝试过动画填充并添加结束动画状态。我搜索和尝试的所有内容似乎都没有帮助。

任何帮助,不胜感激。

整个代码在这里https://jsfiddle.net/qQcFy/105/

CSS 动画代码

@-webkit-keyframes circle {
    from {
        -webkit-transform:rotate(0deg);
    }
    to {
        -webkit-transform:rotate(360deg);
    }
}
@-webkit-keyframes inner-circle {
    from {
        -webkit-transform:rotate(0deg);
    }
    to {
        -webkit-transform:rotate(-360deg);
    }
}
#rotator.is-rotating {
    -webkit-transform:rotate(360deg);
    -webkit-animation: circle 55s linear infinite;
    -webkit-animation-fill-mode: forwards;
}
#rotator.is-rotating.is-paused {
    -webkit-animation-play-state: paused;
}
#rotator .box.is-rotating {
    -webkit-transform:rotate(-360deg);
    -webkit-animation: inner-circle 55s linear infinite;
    -webkit-animation-fill-mode: backwards;
}
#rotator .box.is-rotating.is-paused {
    -webkit-animation-play-state: paused;
}
.box {
    display: inline-block;
    overflow: hidden;
    font-size: 12px;
    border:1px solid black;
    background-color:#ccc;
    text-align:center;
}
.box-small {
    margin: 5px auto 0;
    display: block !important;
    height: 46px;
    width: 47px;
}

添加...

-webkit-backface-visibility: hidden;
-webkit-perspective: 1000;

。到您正在过渡的任何东西。应该根据此处的此文档工作...

最新更新