📜  js为元素添加动画 - Javascript代码示例

📅  最后修改于: 2022-03-11 15:01:34.407000             🧑  作者: Mango

代码示例5
#test {
    background-color: blue;
    width: 100px;
    height: 100px;
    position: relative;
    -webkit-animation: fading 5s infinite;
    animation: fading 5s infinite;
}

/* Here is the animation (keyframes) */
@keyframes fading {
    0% { opacity: 1; }
    100% { opacity: 0; }
}