过渡渐隐
适合两张图片调整其中一个透明度,完整代码:
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<script type="text/javascript" src="http://code.jquery.com/jquery-latest.js"></script>
<title> CSS3实现过渡渐隐动画效果 </title>
</head>
<style>
.pics{
position: relative;
width: 600px;
height: 400px;
margin: 100px auto;
}
.pic1{
width: 600px;
height: 400px;
}
@keyframes picDraw {
0%{
opacity: 0;
}
50%{
opacity: 1;
}
100%{
opacity: 0;
}
}
.pic2{
position: absolute;
width: 600px;
height: 400px;
left: 0;
top: 0;
-webkit-animation: picDraw 5s ease-in-out infinite;
}
</style>
<body>