jQuery基于css3属性制作多张图片层叠,通过按钮控制上下一张卡片切换效果。这是一款不错的ui图片展示特效。
使用方法
1、head引入css文件
<link rel="stylesheet" href="css/style.css">2、body引入部分
<div class="container"> <div class="card-stack"> <a class="buttons prev" href="#"><</a> <ul class="card-list"> <li class="card" style="background: #c31432; /* fallback for old browsers */ background: -webkit-linear-gradient(to right, #240b36, #c31432); /* Chrome 10-25, Safari 5.1-6 */ background: linear-gradient(to right, #240b36, #c31432); /* W3C, IE 10+/ Edge, Firefox 16+, Chrome 26+, Opera 12+, Safari 7+ */ "> <img src="svg/E90.svg" alt="Sun" class="card-list__image"> <h3 class="card-list__text">当你超越竞争对手时,注意你的成功之路。 </h3> </li> <li class="card" style="background: #00416A; background: -webkit-linear-gradient(to right, #FFE000, #799F0C, #00416A); background: linear-gradient(to right, #FFE000, #799F0C, #00416A); "> <img src="svg/E9H.svg" alt="Sun" class="card-list__image"> <h3 class="card-list__text">放松点,冷静点,我们已经为你盖好了。 </h3> </li> <li class="card" style="background: #1e3c72; background: -webkit-linear-gradient(to right, #2a5298, #1e3c72); background: linear-gradient(to right, #2a5298, #1e3c72); "> <img src="svg/E86.svg" alt="Sun" class="card-list__image"> <h3 class="card-list__text">提升你的社交网络形象</h3> </li> <li class="card" style="background: #2C3E50; background: -webkit-linear-gradient(to right, #FD746C, #2C3E50); background: linear-gradient(to right, #FD746C, #2C3E50); "> <img src="svg/E8Y.svg" alt="Sun" class="card-list__image"> <h3 class="card-list__text">在竞争对手中名列前茅</h3> </li> <li class="card" style="background: #373B44; background: -webkit-linear-gradient(to right, #4286f4, #373B44); background: linear-gradient(to right, #4286f4, #373B44); "> <img src="svg/E9z.svg" alt="Sun" class="card-list__image"> <h3 class="card-list__text">为在线课程创建内容</h3> </li> </ul> <a class="buttons next" href="#">></a> </div> </div> <script type="text/javascript" src='js/jquery.min.js'></script> <script type="text/javascript" src="js/script.js"></script>