效果:

关键点:利用keyframes 原理:infinite

注意点:在处理关键帧动画的时候,注意处理好 总共花费的 animation-duration:time  与每帧延延迟的时间的交错;要让动画显得层次感,处理好 每帧的延迟时间;

多注意时间的穿插 ;效果更很好;下面只是我的小插图;画的不一定对;

以下是我的代码;有兴趣拷贝来看看,仅作为我的练习记录;关键帧要兼容其他浏览器,自行补充前缀即可;

下面附上源码;

<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>纯css轮播图</title>
</head> <body> <style>
*{ margin:0 ; padding:0}
ul,li{ list-style:none; margin:0; padding:0;} .box,
.box:after {
position: fixed;
width: 100%;
height: 100%;
top: 0px;
left: 0px;
z-index: 0;
}
.box:after {
content: '';
background: transparent url(../images/pattern.png) repeat top left;
}
.box li span {
width: 100%;
height: 100%;
position: absolute;
top: 0px;
left: 0px;
background-size: cover;
background-position: 50% 50%;
background-repeat: none; background-color:#333;
opacity: 0;
z-index: 0;
-webkit-backface-visibility: hidden;
-webkit-animation: imageAnimation 18s linear infinite 0s;
-moz-animation: imageAnimation 18s linear infinite 0s;
-o-animation: imageAnimation 18s linear infinite 0s;
-ms-animation: imageAnimation 18s linear infinite 0s;
animation: imageAnimation 18s linear infinite 0s;
}
.box li div {
z-index: 1000;
position: absolute;
bottom: 30px;
left: 0px;
width: 100%;
text-align: center;
opacity: 0;
-webkit-animation: titleAnimation 18s linear infinite 0s;
-moz-animation: titleAnimation 18s linear infinite 0s;
-o-animation: titleAnimation 18s linear infinite 0s;
-ms-animation: titleAnimation 18s linear infinite 0s;
animation: titleAnimation 18s linear infinite 0s;
}
.box li div h3 {
font-family: 'BebasNeueRegular', 'Arial Narrow', Arial, sans-serif;
font-size: 160px;
padding: 0 30px;
line-height: 120px;
color: rgba(255,255,255,0.8);
}
.box li:nth-child(1) span { background-image: url(../images/love5.jpg) }
.box li:nth-child(2) span {
background-image: url(../images/love3.jpg);
-webkit-animation-delay: 6s;
-moz-animation-delay: 6s;
-o-animation-delay: 6s;
-ms-animation-delay: 6s;
animation-delay: 6s;
}
.box li:nth-child(3) span {
background-image: url(../images/love1.jpg);
-webkit-animation-delay: 12s;
-moz-animation-delay: 12s;
-o-animation-delay: 12s;
-ms-animation-delay: 12s;
animation-delay: 12s;
}
.box li:nth-child(2) div {
-webkit-animation-delay: 6s;
-moz-animation-delay: 6s;
-o-animation-delay: 6s;
-ms-animation-delay: 6s;
animation-delay: 6s;
}
.box li:nth-child(3) div {
-webkit-animation-delay: 12s;
-moz-animation-delay: 12s;
-o-animation-delay: 12s;
-ms-animation-delay: 12s;
animation-delay: 12s;
} @-webkit-keyframes imageAnimation {
0% {
opacity: 0;
-webkit-animation-timing-function: ease-in;
}
11% {
opacity: 1;
-webkit-transform: scale(1.05);
-webkit-animation-timing-function: ease-out;
}
30% {
opacity: 1;
-webkit-transform: scale(1.1);
}
35% {
opacity: 0;
-webkit-transform: scale(1.1) translateY(-20%);
}
49% {
opacity: 0;
-webkit-transform: scale(1.1) translateY(-60%);
}
100% { opacity: 0 ; -webkit-transform: scale(1.1) translateY(-100%);}
} @-moz-keyframes imageAnimation {
0% {
opacity: 0;
-moz-animation-timing-function: ease-in;
}
11% {
opacity: 1;
-moz-transform: scale(1.05);
-moz-animation-timing-function: ease-out;
}
30% {
opacity: 1;
-moz-transform: scale(1.1);
}
35% {
opacity: 0;
-moz-transform: scale(1.1) translateY(-20%);
}
49% {
opacity: 0;
-moz-transform: scale(1.1) translateY(-60%);
}
100% { opacity: 0 ; -moz-transform: scale(1.1) translateY(-100%);}
} @keyframes imageAnimation {
0% {
opacity: 0;
animation-timing-function: ease-in;
}
11% {
opacity: 1;
transform: scale(1.05);
animation-timing-function: ease-out;
}
30% {
opacity: 1;
transform: scale(1.1);
}
35% {
opacity: 0;
transform: scale(1.1) translateY(-20%);
}
49% {
opacity: 0;
transform: scale(1.1) translateY(-60%);
}
100% { opacity: 0 ; transform: scale(1.1) translateY(-100%);}
} @-webkit-keyframes titleAnimation {
0% {
opacity: 0;
-webkit-transform: translateY(-300%);
}
8% {
opacity: 1;
-webkit-transform: translateY(0%);
}
22% {
opacity: 1;
-webkit-transform: translateY(0%);
}
28% {
opacity: 0;
-webkit-transform: translateY(100%);
}
35% { opacity: 0 }
100% { opacity: 0 }
} @-moz-keyframes titleAnimation {
0% {
opacity: 0;
-moz-transform: translateY(-300%);
}
8% {
opacity: 1;
-moz-transform: translateY(0%);
}
22% {
opacity: 1;
-moz-transform: translateY(0%);
}
28% {
opacity: 0;
-moz-transform: translateY(100%);
}
35% { opacity: 0 }
100% { opacity: 0 }
} @keyframes titleAnimation {
0% {
opacity: 0;
transform: translateY(-300%);
}
8% {
opacity: 1;
transform: translateY(0%);
}
22% {
opacity: 1;
transform: translateY(0%);
}
28% {
opacity: 0;
transform: translateY(100%);
}
35% { opacity: 0 }
100% { opacity: 0 }
} /* Show at least something when animations not supported */
.no-cssanimations .box li span{
opacity: 1;
} </style>
<ul class="box">
<li><span>Image 01</span><div class="title"><h3>第1张</h3></div></li>
<li><span>Image 02</span><div class="title"><h3>第2张</h3></div></li>
<li><span>Image 03</span><div class="title"><h3>第3张</h3></div></li>
</ul> </body>
</html> 其他:
1,相同参数的可以写在一起;
2,可以只有to, 也可以只有类似50% 省略0%和100%;因为后面的会重置前面的样式;

												

纯css3 轮播图 利用keyframes的更多相关文章

  1. 纯CSS3轮播图

    <!DOCTYPE html><html lang="en"><head> <meta charset="UTF-8" ...

  2. 纯js轮播图练习-1

    偶尔练习,看视频自己学着做个简单的纯JS轮播. 简单的纯js轮播图练习-1. 样子就是上面图片那样,先不管好不好看,主要是学会运用和理解轮播的原理 掌握核心的理论知识和技术的操作,其他的都可以在这个基 ...

  3. css 纯css轮播图 示例

    <!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <title&g ...

  4. 纯js轮播图练习-2,js+css旋转木马层叠轮播

    基于css3的新属性,加上js的操作,让现在js轮播图花样越来越多. 而现在出现的旋转木马层叠轮播的轮播图样式,却是得到了很多人都喜爱和投入使用. 尤其是在各大软件中,频繁的出现在大家的眼里,在web ...

  5. 纯js轮播图练习-3,类似于淘宝海报带小圆点轮播图

    基于js和css,跟着网上的视频教程,结合自己想要的效果,做出了一个类似于淘宝海报的效果. 如图:淘宝首页 自己做的: 代码: <!DOCTYPE html> <html> & ...

  6. 纯js轮播图

    <div id="wrapper"> <div id="container"> <img src="http://ima ...

  7. 纯CSS3实现轮播图

    前言 纯css3实现的轮播图效果,和JavaScript控制的相比,简单高效了很多,但是功能也更加单一,只有轮播不能手动切换. 用什么实现的呢?页面布局 + animation动画 HTML部分 &l ...

  8. 纯CSS实现轮播图效果,你不知道的CSS3黑科技

    前言 轮播图已经是一个很常见的东西,尤其是在各大App的首页顶部栏,经常会轮番显示不同的图片. 一提到轮播图如何实现时,很多人的第一反应就是使用Javascript的定时器,当然这种方法是可以实现的. ...

  9. css3 - 纯css实现一个轮播图

    这是我上一次的面试题.一晃两个月过去了. 从前都是拿原理骗人,把怎么实现的思路说出来. 我今天又被人问到了,才想起来真正码出来.码出来效果说明一切: 以上gif,只用到了5张图片,一个html+css ...

随机推荐

  1. 王立平--Failed to push selection: Read-only file system

    往android模拟器导入资源,失败. 提示:仅仅读文件. mnt是仅仅读文件.应点击sdcard.,在导入

  2. Android Wear 数据类型和接口的发送和同步数据概述

    Android Wear数据层API,这是google play service部分,通信信道,以你的手持设备和耐磨应用. Api它包含一系列数据对象,可以让系统通过监控和通知行app重要的事件数据层 ...

  3. Oracle SQL Lesson (6) - 使用Join进行联合查询

    使用连接SQL 1999SELECT table1.column, table2.columnFROM table1[NATURAL JOIN table2] |[JOIN table2 USING ...

  4. struts2 Session拦截器

    一:struts2简介 二:拦截器

  5. HQApi命令行接口配置

    执行的命令行前准备 在您的个人文件夹中第一次创建 型材client.properties 如下面 cd C:\Users\scnyli\ mkdir ".hq" 创建一个 clie ...

  6. android面试题 不单单为了面试也是一次非常好的学习

    以以下试题都是在网上找的总结出来的,谢谢大家的分享!希望,我们共同进步,找到自己梦想的公司: 1.android dvm 的进程和Linux的进程,应用程序的进程是否为同一个概念: 答:dvm是dal ...

  7. android 泰国/缅甸语/捷克较低,Contacts联系出现精神错乱之类的问题清单

    更改ContactsProvider2.java文件 public static final String SECTION_HEADING = "SUBSTR(%1$s,1,1)" ...

  8. selinux 工具下载地址

    http://userspace.selinuxproject.org/releases/ 里面包含了 Name Last modified Size Description Parent Direc ...

  9. 开源一个简单的c++软光栅渲染器

    本文由zhangbaochong原创,转载请注明出处http://www.cnblogs.com/zhangbaochong/p/5751111.html 由于开学就大四面临找工作了,为了整理下项目, ...

  10. SQLServer2008-2012资源及性能监控—CPU使用率监控具体解释

    前言: CPU是server中最重要的资源.在数据库server中,CPU的使用情况应该时刻监控以便SQLServer一直处于最佳状态. 本文将会使用可靠性和性能监视器来获取CPU相关的使用统计信息 ...