当动画停止播放时,DIV会一直返回到相同的位置?

时间:2016-03-28 14:23:29

标签: html css animation

动画停止播放后,Div再次出现,你如何阻止div回到原来的位置?

t = transforms.offset_copy(text._transform, x=ex.width, units='dots')

HTML code:

    #wrapper {
    background-color: #999;
    position: fixed;
    height: 100%;
    width: 100%;
}
#wrapper .section{
    position: absolute;
    top: 0;
    width: 51%;
    height: 100%;
    background: #222222;
}
#wrapper .section.section-left{
    left:0;
    animation: move 1.5s 1;

}
#wrapper .section.section-right{
    right:0;
    animation: move 1.5s 1;

}
@keyframes move{
     0%   {width: 51%;}
    100% {width:0%;}
}

1 个答案:

答案 0 :(得分:0)

您可以将animation-fill-mode: forwards;添加到#wrapper .section.section-left#wrapper .section.section-right

Codepen example