Skip to content

Instantly share code, notes, and snippets.

@bengrosser
Created December 8, 2013 07:14
Show Gist options
  • Save bengrosser/7854240 to your computer and use it in GitHub Desktop.
Save bengrosser/7854240 to your computer and use it in GitHub Desktop.
A Pen by Ben Grosser.
<div id="container">
<div class="slideshow">
<img src="http://bengrosser.com/share/344/cycle1.png" width="851" height="315">
<img src="http://bengrosser.com/share/344/cycle2.png" width="851" height="315">
<img src="http://bengrosser.com/share/344/cycle3.png" width="851" height="315">
<img src="http://bengrosser.com/share/344/cycle4.png" width="851" height="315">
<img src="http://bengrosser.com/share/344/cycle5.png" width="851" height="315">
</div>
</div>
/* when the HTML page is fully loaded */
$(document).ready(function() {
/* find a tag w/ class 'slideshow' and apply
the cycle effect to it with the following
options
*/
$('.slideshow').cycle({
fx:'fade', /* type of transition */
timeout: 3000, /* time between transitions */
pause:1, /* allows mouse hover to pause */
speed: 800 /* how fast to transition */
});
});
/*
try these alternate 'fx' values
blindZ
cover
growY
scrollUp (Down/Right/Left)
shuffle
toss
wipe
(see the full list of fx options here:
http://jquery.malsup.com/cycle/browser.html)
*/
#container {
margin:auto;
width:851px;
margin-top:20px;
}
.slideshow img {
padding:15px;
border:1px solid #ccc;
background-color:#eee;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment