小提琴在这里:http: //jsfiddle.net/r4qyU/
这是一个带有平铺效果的 JQuery Cycle2 幻灯片。我不知道如何将标题放在图像上方。幻灯片具有overflow: hidden
插件应用的样式。
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.js"></script>
<script src="http://malsup.github.com/min/jquery.cycle2.min.js"></script>
<script src="https://rawgithub.com/malsup/cycle2/master/jquery.cycle2.tile.js"></script>
<div class="my-wrapper">
<div class="cycle-slideshow" data-cycle-fx="tileSlide" data-cycle-timeout=2000 data-cycle-caption-template="{{cycleTitle}}">
<img src="http://jquery.malsup.com/cycle2/images/p1.jpg" data-cycle-title="Spring">
<img src="http://jquery.malsup.com/cycle2/images/p2.jpg" data-cycle-title="Redwoods">
<img src="http://jquery.malsup.com/cycle2/images/p3.jpg" data-cycle-title="Angle Island">
<img src="http://jquery.malsup.com/cycle2/images/p4.jpg" data-cycle-title="Raquette Lake">
<div class="cycle-caption"></div>
</div>
</div>
和CSS:
.my-wrapper {
width: 700px;
height: 500px;
background: gray;
padding: 10px;
margin: auto;
}
.cycle-slideshow {
width: 100%;
margin-top: 100px;
}
.cycle-caption {
background: rgba(0,0,0,.5);
font-size: 70px;
right: auto;
height: 80px;
line-height: 80px;
width: 100%;
top: -40px;
}