gpt4 book ai didi

html - -webkit (CSS3) 淡入淡出动画 - 包含 jsFiddle

转载 作者:行者123 更新时间:2023-11-28 19:00:27 25 4
gpt4 key购买 nike

所以我有 3 张图片我想使用 css 属性制作动画,我似乎有两张图片工作正常但看不到如何制作第三张图片的动画。

图像应该如下动画

  • class="top"首先1.5秒
  • class="middle"second for 1.5 seconds
  • class="bottom"第三个 1.5 秒

一次只能看到一张图片。

这是 fiddle 链接:http://jsfiddle.net/sEd9r/

这是代码;

    <!DOCTYPE html> 
<html>
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="chrome=1" />
<title>Untitled Document</title>
</head>

<body>

<div id="cf3" class="shadow">
<img class="bottom" src="http://dl.dropbox.com/u/21893804/s1.jpg" />
<img class="middle" src="http://dl.dropbox.com/u/21893804/s2.jpg" />
<img class="top" src="http://dl.dropbox.com/u/21893804/s3.jpg" />
</div>


</body>
</html>
@-webkit-keyframes cf3FadeInOut {
0% {
opacity:1;
}
100% {
opacity:0;
}
}

@-moz-keyframes cf3FadeInOut {
0% {
opacity:1;
}
100% {
opacity:0;
}
}

#cf3 {
position:relative;
height:60px;
width:480px;
margin:0 auto;
}
#cf3 img {
position:absolute;
left:0;
-webkit-transition: opacity 1s ease-in-out;
-moz-transition: opacity 1s ease-in-out;
-o-transition: opacity 1s ease-in-out;
transition: opacity 1s ease-in-out;
}

#cf3 img.top {
-webkit-animation-name: cf3FadeInOut;
-webkit-animation-timing-function: ease-in-out;
-webkit-animation-iteration-count: infinite;
-webkit-animation-duration: 1.5s;
-webkit-animation-direction: normal;

-moz-animation-name: cf3FadeInOut;
-moz-animation-timing-function: ease-in-out;
-moz-animation-iteration-count: infinite;
-moz-animation-duration: 1.5s;
-moz-animation-direction: normal;

animation-delay:3s;
-webkit-animation-delay:3s; /*Safari and Chrome */
}
#cf3 img.middle {

-webkit-animation-name: cf3FadeInOut;
-webkit-animation-timing-function: ease-in-out;
-webkit-animation-iteration-count: infinite;
-webkit-animation-duration: 1.5s;
-webkit-animation-direction: normal;

-moz-animation-name: cf3FadeInOut;
-moz-animation-timing-function: ease-in-out;
-moz-animation-iteration-count: infinite;
-moz-animation-duration: 1.5s;
-moz-animation-direction: normal;
animation-delay:1.5s;
-webkit-animation-delay:1.5s; /*Safari and Chrome */
}

最佳答案

我认为您需要使动画从 0 淡入到 1,以便在 1/3 的时间内它处于 0。然后您使用延迟将它们错开,以便一次只有一个具有 1 值。

我会在某个时候尝试解决这个问题!

关于html - -webkit (CSS3) 淡入淡出动画 - 包含 jsFiddle,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6056268/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com