【发布时间】:2017-05-16 05:34:57
【问题描述】:
我在一个网站上工作,我想知道不透明度的连续变化究竟是如何发生的,在后台......
这是链接: 我希望它像这样工作http://www.cecchi.net/ ~
伙计们,我使用 css 动画.. 和关键帧类似的作品,但问题是我不知道如何将不透明度随机分配给每个部门.. 这是代码:
<!DOCTYPE html>
<html>
<head>
<style>
.div1,
div2 {
width: 100px;
height: 100px;
background-color: red;
animation-name: example;
animation-duration: 4s;
animation-iteration-count: infinite;
}
/* Standard syntax */
@keyframes example {
0% {
opacity: 1;
}
20% {
opacity: 0.8;
}
40% {
opacity: 0.3;
}
60% {
opacity: 0.6;
}
80% {
opacity: 0.8;
}
100% {
opacity: 1;
}
.div1 {
width: 100px;
height: 100px;
background-color: red;
animation-name: example;
animation-duration: 4s;
animation-iteration-count: infinite;
}
}
.div2 {
width: 100px;
height: 100px;
background-color: red;
animation-name: example;
animation-duration: 4s;
animation-iteration-count: infinite;
}
box-sizing: border-box;
}
</style>
</head>
<body>
<div class="div1"></div>
<br>
<div class="div2"></div>
</body>
</html>
【问题讨论】:
-
您正在寻找 CSS 动画。
-
@试过了...但我遇到了困难。对不起,我是这个新手.. xD
标签: jquery html css twitter-bootstrap