Skip to content

Instantly share code, notes, and snippets.

@paulmist
Forked from Wilto/gist:1107253
Created August 20, 2011 14:14
Show Gist options
  • Save paulmist/1159156 to your computer and use it in GitHub Desktop.
Save paulmist/1159156 to your computer and use it in GitHub Desktop.
Example Fade-y Slideshow Thing
.faderotate {
height: 250px;
position: relative;
width: 100%;
}
.faderotate .slide {
left: 0;
position: absolute;
top: 0;
width: 100%;
}
.faderotate .hidden {
left: -9999px;
}
<a href="#" class="next">Next</a>
<a href="#" class="prev">Prev</a>
<ol class="faderotate">
<li class="slide">
Stuff
</li>
<li class="slide">
Things
</li>
</ol>
$('.slide').not(':first').addClass('hidden');
$('.next').click(function() {
$('.slide:visible')
.addClass('hidden')
.next()
.removeClass('hidden');
});
$('.prev').click(function() {
$('.slide:visible')
.addClass('hidden')
.prev()
.removeClass('hidden');
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment