-
-
Save paulmist/1159156 to your computer and use it in GitHub Desktop.
Example Fade-y Slideshow Thing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.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