• css实现图标移上图标弹跳效果


    html部分:

    <div class="bounce" style="20px;height:20px;border:1px solid red;"></div>
    

    css部分:

    .bounce:hover{border:1px solid #FF00FF;background:#00FF00;-webkit-animation:bounce 1s;animation:bounce 1s;animation-iteration-count: infinite;-webkit-transform-origin:center bottom;transform-origin:center bottom;}
    
    @-webkit-keyframes bounce{from,20%,53%,80%,to{-webkit-animation-timing-function:cubic-bezier(0.215,0.610,0.355,1.000);animation-timing-function:cubic-bezier(0.215,0.610,0.355,1.000);-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0);}40%,43%{-webkit-animation-timing-function:cubic-bezier(0.755,0.050,0.855,0.060);animation-timing-function:cubic-bezier(0.755,0.050,0.855,0.060);-webkit-transform:translate3d(0,-15px,0);transform:translate3d(0,-15px,0);}70%{-webkit-animation-timing-function:cubic-bezier(0.755,0.050,0.855,0.060);animation-timing-function:cubic-bezier(0.755,0.050,0.855,0.060);-webkit-transform:translate3d(0,-7px,0);transform:translate3d(0,-7px,0);}90%{-webkit-transform:translate3d(0,-2px,0);transform:translate3d(0,-2px,0);}}
    @keyframes bounce{from,20%,53%,80%,to{-webkit-animation-timing-function:cubic-bezier(0.215,0.610,0.355,1.000);animation-timing-function:cubic-bezier(0.215,0.610,0.355,1.000);-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0);}40%,43%{-webkit-animation-timing-function:cubic-bezier(0.755,0.050,0.855,0.060);animation-timing-function:cubic-bezier(0.755,0.050,0.855,0.060);-webkit-transform:translate3d(0,-15px,0);transform:translate3d(0,-15px,0);}70%{-webkit-animation-timing-function:cubic-bezier(0.755,0.050,0.855,0.060);animation-timing-function:cubic-bezier(0.755,0.050,0.855,0.060);-webkit-transform:translate3d(0,-7px,0);transform:translate3d(0,-7px,0);}90%{-webkit-transform:translate3d(0,-2px,0);transform:translate3d(0,-2px,0);}}
    .bounceIn{-webkit-animation-name:bounceIn;animation-name:bounceIn;}
    @-webkit-keyframes bounceIn{from,20%,40%,60%,80%,to{-webkit-animation-timing-function:cubic-bezier(0.215,0.610,0.355,1.000);animation-timing-function:cubic-bezier(0.215,0.610,0.355,1.000);}0%{opacity:0;-webkit-transform:scale3d(.3,.3,.3);transform:scale3d(.3,.3,.3);}20%{-webkit-transform:scale3d(1.1,1.1,1.1);transform:scale3d(1.1,1.1,1.1);}40%{-webkit-transform:scale3d(.9,.9,.9);transform:scale3d(.9,.9,.9);}60%{opacity:1;-webkit-transform:scale3d(1.03,1.03,1.03);transform:scale3d(1.03,1.03,1.03);}80%{-webkit-transform:scale3d(.97,.97,.97);transform:scale3d(.97,.97,.97);}to{opacity:1;-webkit-transform:scale3d(1,1,1);transform:scale3d(1,1,1);}}
    @keyframes bounceIn{from,20%,40%,60%,80%,to{-webkit-animation-timing-function:cubic-bezier(0.215,0.610,0.355,1.000);animation-timing-function:cubic-bezier(0.215,0.610,0.355,1.000);}0%{opacity:0;-webkit-transform:scale3d(.3,.3,.3);transform:scale3d(.3,.3,.3);}20%{-webkit-transform:scale3d(1.1,1.1,1.1);transform:scale3d(1.1,1.1,1.1);}40%{-webkit-transform:scale3d(.9,.9,.9);transform:scale3d(.9,.9,.9);}60%{opacity:1;-webkit-transform:scale3d(1.03,1.03,1.03);transform:scale3d(1.03,1.03,1.03);}80%{-webkit-transform:scale3d(.97,.97,.97);transform:scale3d(.97,.97,.97);}to{opacity:1;-webkit-transform:scale3d(1,1,1);transform:scale3d(1,1,1);}}

    其中 animation-iteration-count为播放动画次数,infinite为无限次。

      

  • 相关阅读:
    自动化:Appium运行成功,取得一个小的胜利
    调优案例1
    HTTP请求方式中8种请求方法(简单介绍)
    Java中基本类型和引用类型(简单介绍)
    @WebListener 注解方式实现监听(eclipse和idea)
    Git免密码提交
    在idea配置jetty和创建(包、文件)javaWeb以及Servlet简单实现
    emmet工具使用和技巧
    Markdown基本语法总结
    viewport原理和使用和设置移动端自适应的方法(移动适应电脑)
  • 原文地址:https://www.cnblogs.com/1246447850qqcom/p/7883722.html
Copyright © 2020-2023  润新知