javascript - an html element that can swing up and down
某草草
某草草 2017-05-19 10:44:32
0
4
526

Website http://zm.163.com/

How to achieve this effect

某草草
某草草

reply all(4)
仅有的幸福

It’s just a simple CSS3 animation

.light_pc {
        width: 93px;
        height: 9px;
        position: absolute;
        top: 0;
        left: 50%;
        margin-left: -46px;
        background: url(https://zm.res.netease.com/pc/fab/20161226201931/img/light_pc_f3d5dee.png?_sprite) no-repeat;
        -moz-animation: light_pc 4s linear 0s infinite;
        -webkit-animation: light_pc 4s linear 0s infinite;
        -o-animation: light_pc 4s linear 0s infinite;
        -ms-animation: light_pc 4s linear 0s infinite;
        animation: light_pc 4s linear 0s infinite
    }
    
    @-webkit-keyframes light_pc {
        0% {
            top: 0
        }
        50% {
            top: 83px
        }
        100% {
            top: 0
        }
    }
    
    @-moz-keyframes light_pc {
        0% {
            top: 0
        }
        50% {
            top: 83px
        }
        100% {
            top: 0
        }
    }
    
    @-ms-keyframes light_pc {
        0% {
            top: 0
        }
        50% {
            top: 83px
        }
        100% {
            top: 0
        }
    }
    
    @-o-keyframes light_pc {
        0% {
            top: 0
        }
        50% {
            top: 83px
        }
        100% {
            top: 0
        }
    }
    
    @keyframes light_pc {
        0% {
            top: 0
        }
        50% {
            top: 83px
        }
        100% {
            top: 0
        }
    }
PHPzhong

View elements and learn more about CSS animation

伊谢尔伦

There is a p outside the QR code image that is the same height as the image
Use: before
to make a horizontal line
Write css3 animation to move

Ty80

I will also post my animation

  demo {
  transform: translate3d(0, 0, 0);
  animation: bounce 0.8s infinite ease-out;
}
@-webkit-keyframes bounce {
  50% {
    transform: translate3d(0, -0.2rem, 0);
  }
}
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!