1、animation 动画

  概念:当您在 @keyframes 中创建动画时,请把它捆绑到某个选择器,否则不会产生动画效果。

  通过规定至少以下两项 CSS3 动画属性,即可将动画绑定到选择器:

  • 规定动画的名称
  • 规定动画的时长

把 "myMove" 动画捆绑到 div 元素,时长:5 秒;

  1. 动画调用
  2. 调用动画的规则名称
  3. 动画持续的时间(可选)
  4. 动画的过渡类型
  5. 延迟时间
  6. 动画播放次数(默认1次,也可以成数字或者infinite则是无限循环)
  7. 是否停留在结束状态 forwards
  8. 反向运动 alternate 1

2、调用形式如下所示:---------------可以互相组合使用

 -webkit-animation: myMove 2s ;
-webkit-animation: myMove 2s linear 2s infinite ;无限循环
-webkit-animation: myMove 2s linear 2s 2 ;循环2次
-webkit-animation: myMove 2s linear 2s forwards ;停留在结束位置
-webkit-animation: myMove 4s linear 2s infinite alternate ;反向运动不能在1次运动时实现,播放次数必须在2次或2次以上才可以实现

3、复杂的动画调用规则:

A、动画规则的设置:

 @-webkit-keyframes myMove {
from{
margin-left: 0px;
background-color: orange;
}to{
margin-left: 200px;
background-color: rosybrown;
}
}

B、动画规则的设置,用百分比实现

 @-webkit-keyframes myMove{

 0%{ width: 200px; }
20%{ width: 200px; }
40%{width: 200px; }
60%{ width: 200px; }
100%{ width: 200px; }
}

4、暂停动画:

代码:animation-play-state: paused;

用途:用在轮播上,要借用hover属性来实现;表示鼠标移上去是动画停止,移出时动画继续

实例:

下面是调用动画:

 #boxhidden{
border: 1px solid rosybrown;
width: 320px;
height: 213px;
overflow: hidden;
} #boximg{
height: 213px;
width: 1920px;
font-size:;
animation: imgmove 4s linear infinite;
}
#boximg:hover{
animation-play-state: paused;
}

动画规则设置:

 @-webkit-keyframes imgmove {
0%{margin-left: 0px; } 10%{margin-left: -320px; }20%{ margin-left: -320px; }
30%{ margin-left: -640px; }40%{margin-left: -640px; }50%{margin-left: -960px; }
60%{ margin-left: -960px; }70%{margin-left: -1280px; }80%{margin-left: -1280px}
90%{margin-left: -1600px} 100%{margin-left: -1600px}
}

animation(动画)设置的更多相关文章

  1. Android中xml设置Animation动画效果详解

    在 Android 中, Animation 动画效果的实现可以通过两种方式进行实现,一种是 tweened animation 渐变动画,另一种是 frame by frame animation ...

  2. android中设置Animation 动画效果

    在 Android 中, Animation 动画效果的实现可以通过两种方式进行实现,一种是 tweened animation 渐变动画,另一种是 frame by frame animation ...

  3. CSS3 animation 动画

    今天看到一个很酷的logo看了下他用的是animation 动画效果,就拿来做例子 浏览器支持 Internet Explorer 10.Firefox 以及 Opera 支持 animation 属 ...

  4. Android Property Animation动画

    3.0以前,android支持两种动画模式,tween animation,frame animation,在android3.0中又引入了一个新的动画系统:property animation,这三 ...

  5. android Animation 动画绘制逻辑

    参考:http://www.jianshu.com/p/3683a69c38ea 1.View.draw(Canvas) 其中步骤为:/* * Draw traversal performs seve ...

  6. 转 iOS Core Animation 动画 入门学习(一)基础

    iOS Core Animation 动画 入门学习(一)基础 reference:https://developer.apple.com/library/ios/documentation/Coco ...

  7. css3 animation动画技巧

    一,css3 animation动画前言 随着现在浏览器对css3的兼容性越来越好,使用css3动画来制作动画的例子也越来越广泛,也随着而来带来了许多的问题值得我们能思考.css3动画如何让物体运动更 ...

  8. 【Android 基础】Animation 动画介绍和实现

    在前面PopupWindow 实现显示仿腾讯新闻底部弹出菜单有用到Animation动画效果来实现菜单的显示和隐藏,本文就来介绍下吧. 1.Animation 动画类型 Android的animati ...

  9. Android Animation 动画属性

    在 Android 中, Animation 动画效果的实现可以通过两种方式进行实现: 一种是 tweened animation 渐变动画,另一种是 frame by frame animation ...

  10. [转]Animation 动画详解(一)——alpha、scale、translate、rotate、set的xml属性及用法

    转载:http://blog.csdn.net/harvic880925/article/details/39996643 前言:这几天做客户回访,感触很大,用户只要是留反馈信息,总是一种恨铁不成钢的 ...

随机推荐

  1. Python & Selenium & Pycharm 环境搭建

    最近在研究python+selenium进行自动化测试.然后用的python开发工具是Pycharm.然后,今天就跟大家讲一下怎么搭建一整套的自动化测试环境. 安装python 首先,安装python ...

  2. C#复制粘贴

    用C#程序复制粘贴非常简单,这里为了实用,只介绍对文字的操作,其他情况类似: Clipboard.SetText(“我是需要复制到系统剪贴板的文字”); 执行以上代码后,即可ctrl+V进行粘贴.是不 ...

  3. ns2.35-classifier.cc

    line143:recv() /* -*- Mode:C++; c-basic-offset:8; tab-width:8; indent-tabs-mode:t -*- */ /* * Copyri ...

  4. Eclipse如何设置编译文件.class输出路径

    1.首先我发现我的eclipse中-->project-->build automatically 是勾选上的.好吧,把把前面的勾去掉. 2去掉以后我先clean --> Clean ...

  5. VS2015配置Entity Framework Power Tools Bate4,还有一些使用与注意的地方

    今天使用vs2015重新安装了这个名为Entity Framework Power Tools的插件,由于它只支持到2013,因此需要进行一些操作方能使用 下面是一些参考文档 http://www.c ...

  6. DevExpress源码编译总结 z

    本篇文章内容包括基础知识(GAC.程序集强签名.友元程序集).编译过程.注册GAC.添加工具箱.多语言支持.运行时和设计时调试 源码地址 链接:http://pan.baidu.com/s/1eQm1 ...

  7. python 线程中的局部变量ThreadLocal

    一个线程使用自己的局部变量比使用全局变量好局部变量只有线程自己能看见,不会影响其他线程全局变量的修改必须加锁 ThreadLocal 线程局部变量 import threading # 创建全局Thr ...

  8. 奇葩拿shell + 提权wind08r2奇葩拿shell + 提权wind08r2戏

    0x01 小隐拿站篇 某省还是市级还是县级的空防部 先来刺探目录,拿起御剑, 啪啪啪  (鼓掌)后台出来了   试试弱口令 擦  需要管理员验证码,这个咋玩????这个注入都不用找了,就算注射出账号密 ...

  9. Oracle创建自增序列

    Oracle没有自增字段这样的功能,但是通过触发器(trigger)和序列(sequence)可以实现. 先建一个测试表了: create table userlogin( id   number(6 ...

  10. functions and closures are reference types-函数和闭包是引用类型

    Closures Are Reference Types In the example above, incrementBySeven and incrementByTen are constants ...