javascript - 一个可以上下摆动的html元素
某草草
某草草 2017-05-19 10:44:32
0
4
542

网址 http://zm.163.com/

这个效果怎么实现的

某草草
某草草

全部回复(4)
仅有的幸福

就是一个简单CSS3 动画

.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

查看元素,具体了解下css的animation

伊谢尔伦

二维码图片外面有一个p和图片高度大小一致
用:before
做出一条横线
写css3动画移动

Ty80

我也晒一下我的动画

  demo {
  transform: translate3d(0, 0, 0);
  animation: bounce 0.8s infinite ease-out;
}
@-webkit-keyframes bounce {
  50% {
    transform: translate3d(0, -0.2rem, 0);
  }
}
热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板
关于我们 免责声明 Sitemap
PHP中文网:公益在线PHP培训,帮助PHP学习者快速成长!