Simple Slideshow with Next and Previous Buttons
Taking from: http://snook.ca/archives/javascript/simplest-jquery-slideshow
I edited the script so that you can navigate through the photos using the previous/next buttons.
HTML
<div id="img-grp-wrap">
<div class="img-wrap">
<img src="http://127.0.0.1:81/Data/assets/images/gravatar.jpg" />
<img src="http://0.tqn.com/d/paganwiccan/1/G/T/1/-/-/BlackCat.jpg" />
<img src="http://www.trans4mind.com/personal_development/JavaScript/hand.gif" />
</div>
<img src="http://annhowardesign.com/images/arrowright.jpg" class="next" alt="Next"/>
<img src="http://annhowardesign.com/images/arrowleft.jpg" class="prev" alt="Previous"/>
</div>
CSS
#img-grp-wrap {
position: relative;
width: 180px;
height: 180px;
margin: 100px auto;
}
.img-wrap {
position: relative;
border: 1px solid #CCC;
width: 180px;
height: 180px;
}
.img-wrap img {
// position: absolute;
top: 0;
left: 0;
-moz-box-shadow: 1px 1px 4px #CCC;
padding: 10px;
}
.next, .prev {
//position: absolute;
cursor: pointer;
top: 70px;
}
.next {
right: -40px;
}
.prev {
left: -40px;
}
JavaScript
$('.img-wrap img:gt(0)').hide();
$('.next').click(function() {
$('.img-wrap img:first-child').fadeOut().next().fadeIn().end().appendTo('.img-wrap');
});
$('.prev').click(function() {
$('.img-wrap img:first-child').fadeOut();
$('.img-wrap img:last-child').prependTo('.img-wrap').fadeOut();
$('.img-wrap img:first-child').fadeIn();
});