我想在这张图片上制作类似的滑块http://prntscr.com/mv67ms 但我不知道如何更改动画以获得类似的效果。有人可以提供帮助吗,或者有人可以使用类似的滑块保存指向Codepen的链接? (原始:https://stripe.com/us/payments) 我做了什么: https://codepen.io/danil-ignatenko/pen/rRmEam
我的代码:
<div class="your-class">
<div class="slide">your content</div>
<div class="slide">your content</div>
<div class="slide">your content</div>
<div class="slide">your content</div>
<div class="slide">your content</div>
<div class="slide">your content</div>
</div>
css:
.your-class {
margin-top: 200px;
margin-left: 50%;
width: 100px;
}
.slide {
display: block;
height: 100px !important;
width: 100px;
background: #f9f9f9;
position: relative;
-webkit-box-shadow: 0px 7px 15px 0px rgba(0,0,0,0.75);
-moz-box-shadow: 0px 7px 15px 0px rgba(0,0,0,0.75);
box-shadow: 0px 7px 15px 0px rgba(0,0,0,0.75);
}
.slick-active {
position: relative;
z-index: 5;
}
.slick-active + .slick-slide {
position: relative;
top: -95px;
z-index: 4;
}
.slick-active + .slick-slide + .slick-slide {
position: relative;
top: -190px;
z-index: 3;
}
.slick-list {
height: 120px !important;
}
js:
$(document).ready(function(){
$('.your-class').slick({
slidesToShow: 1,
vertical: true,
infinite: true,
autoplay: 1,
speed: 1000,
autoplaySpeed: 5000,
});
});