• keyframes 放大缩小动画


    本次项目中动画放大缩小代码小结

    .fix .phone{ -moz-animation: myfirst 1s infinite; -webkit-animation: myfirst 1s infinite; -o-animation: myfirst 1s infinite; animation: myfirst 1s infinite;}
    @keyframes myfirst{
    0% { transform: scale(.8); }
    50% { transform: scale(1); }
    100% { transform: scale(.8); }
    }
    @-moz-keyframes myfirst{
    0%	{-moz-transform: scale(.8);}
    50%	{-moz-transform: scale(1);}
    100%	{-moz-transform: scale(.8);}
    }
    @-webkit-keyframes myfirst{
    0%	{-webkit-transform: scale(.8);}
    50%	{-webkit-transform: scale(1);}
    100%	{-webkit-transform: scale(.8);}
    }
    
    @-o-keyframes myfirst{
    0%	{-o-transform: scale(.8);}
    50%	{-o-transform: scale(1);}
    100%	{-o-transform: scale(.8);}
    }
    

      参考代码:

     1 <!DOCTYPE html>
     2 <html>
     3 <head>
     4 <style> 
     5 div
     6 {
     7 width:100px;
     8 height:100px;
     9 background:red;
    10 position:relative;
    11 animation:mymove 5s infinite;
    12 -moz-animation:mymove 5s infinite; /* Firefox */
    13 -webkit-animation:mymove 5s infinite; /* Safari and Chrome */
    14 -o-animation:mymove 5s infinite; /* Opera */
    15 }
    16 
    17 @keyframes mymove
    18 {
    19 0%   {top:0px; left:0px; background:red;}
    20 25%  {top:0px; left:100px; background:blue;}
    21 50%  {top:100px; left:100px; background:yellow;}
    22 75%  {top:100px; left:0px; background:green;}
    23 100% {top:0px; left:0px; background:red;}
    24 }
    25 
    26 @-moz-keyframes mymove /* Firefox */
    27 {
    28 0%   {top:0px; left:0px; background:red;}
    29 25%  {top:0px; left:100px; background:blue;}
    30 50%  {top:100px; left:100px; background:yellow;}
    31 75%  {top:100px; left:0px; background:green;}
    32 100% {top:0px; left:0px; background:red;}
    33 }
    34 
    35 @-webkit-keyframes mymove /* Safari and Chrome */
    36 {
    37 0%   {top:0px; left:0px; background:red;}
    38 25%  {top:0px; left:100px; background:blue;}
    39 50%  {top:100px; left:100px; background:yellow;}
    40 75%  {top:100px; left:0px; background:green;}
    41 100% {top:0px; left:0px; background:red;}
    42 }
    43 
    44 @-o-keyframes mymove /* Opera */
    45 {
    46 0%   {top:0px; left:0px; background:red;}
    47 25%  {top:0px; left:100px; background:blue;}
    48 50%  {top:100px; left:100px; background:yellow;}
    49 75%  {top:100px; left:0px; background:green;}
    50 100% {top:0px; left:0px; background:red;}
    51 }
    52 </style>
    53 </head>
    54 <body>
    55 
    56 <p><b>注释:</b>本例在 Internet Explorer 中无效。</p>
    57 
    58 <div></div>
    59 
    60 </body>
    61 </html>
  • 相关阅读:
    Linux-Deepin下搭建云笔记
    MySQL-脏页的刷新机制
    网络编程-Netty-writeAndFlush方法原理分析 以及 close以后是否还能写入数据?
    MySQL-SQL调优-引擎选错索引或者不使用索引分析 和 字符串加索引的方式思考
    字体的一些属性
    css清除浮动大全,共8种方法
    WEB前端开发人员须知的常见浏览器兼容问题及解决技巧
    区别各种IE浏览器和火狐的css写法
    IE和火狐浏览器对css解析的不一致
    使用photowap插件
  • 原文地址:https://www.cnblogs.com/jeremylee/p/5501858.html
Copyright © 2020-2023  润新知