Cycle 2 Slideshow
by Laurie
HTML
<script src="http://malsup.github.io/min/jquery.cycle2.min.js"></script>
<div class="cycle-slideshow" data-cycle-fx="fade" data-cycle-speed="600" data-cycle-manual-speed="2000" data-cycle-timeout="5000" data-cycle-pager=".example-pager" data-cycle-auto-height="600:300" data-cycle-loader="wait" data-cycle-slides="> div.fcSlides">
<div class="fcSlides">
<img src="http://lorempixel.com/400/200" />
<div>Title 1</div>
</div>
<div class="fcSlides">
<img src="http://lorempixel.com/400/200/sports" />
<div>Title 2</div>
</div>
<div class="fcSlides">
<img src="http://lorempixel.com/400/200/sports/1" />
<div>Title 3</div>
</div>
</div><!-- END cycle-slideshow DIV -->
<div class="example-pager"></div>
CSS
/*
these are just the default styles used in the Cycle2 demo pages.
you can use these styles or any others that you wish.
*/
/* set border-box so that percents can be used for width, padding, etc (personal preference) */
.cycle-slideshow, .cycle-slideshow * { -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; }
.cycle-slideshow { width: 45%; min-width: 600px; max-width: 600px; margin: 10px auto; padding: 0; position: relative;
/* background: url(http://malsup.github.com/images/spinner.gif) 50% 50% no-repeat;*/
}
/* slideshow images (for most of the demos, these are the actual "slides") */
.cycle-slideshow img {
/*
some of these styles will be set by the plugin (by default) but setting them here
helps avoid flash-of-unstyled-content
*/
position: absolute; top: 0; left: 0;
width: 100%; padding: 0; display: block;
}
/* in case script does not load */
.cycle-slideshow img:first-child {
position: static; z-index: 100;
}
/* pager */
.cycle-pager {
text-align: center; width: 100%; z-index: 500; position: absolute; top: 10px; overflow: hidden;
}
.cycle-pager span {
font-family: arial; font-size: 50px; width: 16px; height: 16px;
display: inline-block; color: #ddd; cursor: pointer;
}
.cycle-pager span.cycle-pager-active { color: #D69746;}
.cycle-pager > * { cursor: pointer;}
.example-pager { text-align: center; width: 100%; z-index: 500; top: 10px; overflow: hidden; }
.example-pager span { font-size: 50px; width: 16px; height: 16px; display: inline-block; color: #ddd; }
.example-pager span.cycle-pager-active { color: #D69746;}
.example-pager > * { cursor: pointer;}
/* caption */
.cycle-caption { position: absolute; color: white; bottom: 15px; right: 15px; z-index: 700; }
/* overlay */
.cycle-overlay {
font-family: tahoma, arial;
position: absolute; bottom: 0; width: 100%; z-index: 600;
background: black; color: white; padding: 15px; opacity: .5;
}
/*...