html图片从中间淡入淡出效果,CSS中的多个图像交叉淡入淡出-无需(java)脚本
小编典典
如果您知道有多少张图片,可以使用CSS3轻松完成。
#crossfade > img {
width: 100%;
height: 100%;
position: absolute;
top: 0px;
left: 0px;
color: transparent;
opacity: 0;
z-index: 0;
-webkit-backface-visibility: hidden;
-webkit-animation: imageAnimation 30s linear infinite 0s;
-moz-animation: imageAnimation 30s linear infinite 0s;
-o-animation: imageAnimation 30s linear infinite 0s;
-ms-animation: imageAnimation 30s linear infinite 0s;
animation: imageAnimation 30s linear infinite 0s;
}
“ -webkit-animation:imageAnimation 30s 线性 无限 0s; ”处的“ 30s”
表明,每个图像的动画将无限次持续30秒。
#crossfade > img:nth-child(2) {
background-image: url(../images/2.jpg);
-webkit-animation-delay: 6s;
-moz-animation-delay: 6s;
-o-animation-delay: 6s;
-ms-animation-delay: 6s;
animation-delay: 6s;
}
#crossfade > img:nth-child(3) {
background-image: url(../images/3.jpg);
-webkit-animation-delay: 12s;
-moz-animation-delay: 12s;
-o-animation-delay: 12s;
-ms-animation-delay: 12s;
animation-delay: 12s;
}
#crossfade > img:nth-child(4) {
background-image: url(../images/4.jpg);
-webkit-animation-delay: 18s;
-moz-animation-delay: 18s;
-o-animation-delay: 18s;
-ms-animation-delay: 18s;
animation-delay: 18s;
}
#crossfade > img:nth-child(5) {
background-image: url(../images/5.jpg);
-webkit-animation-delay: 24s;
-moz-animation-delay: 24s;
-o-animation-delay: 24s;
-ms-animation-delay: 24s;
animation-delay: 24s;
}
@-webkit-keyframes imageAnimation {
0% { opacity: 0;
-webkit-animation-timing-function: ease-in; }
8% { opacity: 1;
-webkit-animation-timing-function: ease-out; }
17% { opacity: 1 }
25% { opacity: 0 }
100% { opacity: 0 }
}
@-moz-keyframes imageAnimation {
0% { opacity: 0;
-moz-animation-timing-function: ease-in; }
8% { opacity: 1;
-moz-animation-timing-function: ease-out; }
17% { opacity: 1 }
25% { opacity: 0 }
100% { opacity: 0 }
}
@-o-keyframes imageAnimation {
0% { opacity: 0;
-o-animation-timing-function: ease-in; }
8% { opacity: 1;
-o-animation-timing-function: ease-out; }
17% { opacity: 1 }
25% { opacity: 0 }
100% { opacity: 0 }
}
@-ms-keyframes imageAnimation {
0% { opacity: 0;
-ms-animation-timing-function: ease-in; }
8% { opacity: 1;
-ms-animation-timing-function: ease-out; }
17% { opacity: 1 }
25% { opacity: 0 }
100% { opacity: 0 }
}
@keyframes imageAnimation {
0% { opacity: 0;
animation-timing-function: ease-in; }
8% { opacity: 1;
animation-timing-function: ease-out; }
17% { opacity: 1 }
25% { opacity: 0 }
100% { opacity: 0 }
}
2020-05-16
html图片从中间淡入淡出效果,CSS中的多个图像交叉淡入淡出-无需(java)脚本相关推荐
- html5 css透明效果,css中实现背景透明的三种方式
css中实现背景透明通常有如下3种方式,以下是这三种方式的不透明度为80%的写法: css3的opacity:x,x 的取值从 0 到 1,如opacity: 0.8 css3的rgba(red, g ...
- html 实现格子效果,CSS中网格效果的实现方案
网络效果如下所示: 网格效果示例.png 在CSS中,网格效果的应用还是很广泛的,比如:棋盘格效果.参考线效果等等: 在CSS中实现颜色突变的效果有多种方案,如下: 方案1:table样式 这个方案的 ...
- css持续淡入淡出,在CSS中连续的淡入淡出效果
代码: CSS: body { background: #fff; } @-webkit-keyframes 'blink' { 0% { opacity:1; } 50% { opacity:0; ...
- html 图片隐藏 一部分,如何在HTML / CSS中仅显示图像的一部分?
虽然您已经接受了答案,但我只是要添加一个(有点鲜为人知的)clipcss属性,尽管它确实要求被裁剪的元素是position: absolute;(这很可惜): .container { positio ...
- C# 仿金山毒霸启动和关闭淡入淡出效果
C# 仿金山毒霸启动和关闭淡入淡出效果 原文 C# 仿金山毒霸启动和关闭淡入淡出效果 01 #region 窗体关闭效果 02 03 #region 私有方法 04 [DllImportAttri ...
- cool edit 如何制作声音淡出效果?
将音乐用软件打开,点击单轨编辑(默认),然后选中你想将之淡出的声音段. 点上面工具栏的"效果"--"波形振幅"--"渐变" 就会出来一个面板 ...
- html src 图片不显示图片,css中不用src也让图片显示的方法是什么?
在网页中有两种调用图片的方法,分别是使用img标签和使用background-image属性引入图片,其中使用img标签引入图片需要使用src属性. css中不用src让图片显示的方法是使用backg ...
- php css定位到图片上,CSS_浅谈css中图片定位之所有图标放在一张图上,如今做网页为了使网站丰富多 - phpStudy...
浅谈css中图片定位之所有图标放在一张图上 如今做网页为了使网站丰富多彩,富于表现力,往往需要应用大量的图片/图标.如何处理这些图片,使其尽量不影响网页载入,解析等速度,是一个不大不小的问题.如果你的 ...
- animation css 透明度逐渐_CSS实现透明度变化的动画 (淡入淡出效果)
本文我们将使用CSS来实现透明度发生变化的动画,可以获得淡入和淡出效果. 要实现CSS中透明度更改的动画,需要使用的是transition属性.由于transition属性是CSS3中的新增属性,因此 ...
最新文章
- Control Channel Element (CCE)
- 住房要注意用电安全-记录一下失火
- 一段代码到可执行程序所有经历
- 免费网络推广浅析对网站首页优化的注意细节把控!
- Android的AutoCompleteTextView在API17高版本添加的setText函数在低版本系统居然能正常调用?官方文档是不是不靠谱了?...
- python批量分析表格_示例python 批量操作excel统计销售榜品牌及销售额
- 读书笔记之快速排序(一)
- 简单程序计算无穷级数e^x
- 高性能MySQL-3rd-(六)查询性能优化
- SSH集成之导入导出代码示例-页面部分(1)
- 21.IO-multiplexing方式实现Netcat
- (二)Linux 权限
- matlab 单相整流电路,MATLAB的单相桥式整流电路研究
- python爬虫得到谷歌学术搜索结果
- VAF,MAF,肿瘤纯度,MCF,CCF的概念和计算方法 (转载)
- dell win10忘记密码怎么办
- [翻译]在Windows版或MacOS版的Microsoft Edge上安装一个谷歌浏览器拓展
- 如何在配置低的老旧笔记本的win7系统上安装tensorflow及报错信息解决方法集锦
- 【无标题】.Net Core 6.0 WebApi 远程部署到Server2016
- mongodb 集群shard_MongoDBV3.0.7版本(shard+replica)集群的搭建及验证
热门文章
- Vue中子组件如何向父组件传递数据?
- 报错,could not execute statement; SQL [n/a]; constraint [null]; nested exception is org.hibernate.exce
- 如何让CentOS8虚拟机与主机相互Ping通
- 配置Apache服务器的虚拟主机
- Go程序:演示数组切片用法
- 【BZOJ4816】数字表格,反演+枚举约数
- Linux实战 | 搭建Linux(CentOS6.8版)_1
- python 类特殊方法_Python 定制类的特殊方法与授权
- java项目日志文件过大解决_Tomcat catalina.out文件过大的解决方案
- Interactive Python:Mini-project # 1 - Guess the number game