CSS:
.slider_img img {
display: none;
}
HTML:
<div class="slider_img">
<img src="/uploads/usertemplates/slider1.png">
<img src="/uploads/usertemplates/slider2.png">
<img src="/uploads/usertemplates/slider3.png">
</div>
<input type="button" onclick="slider(false)" value="Prev" />
<input type="button" onclick="slider(true)" value="Next" />
JS:
var sliderIndex = -1, imgs = $('.slider_img img');
function slider(a) {
sliderIndex += a ? 1 : -1;
if(!imgs[sliderIndex]) sliderIndex = a ? 0 : imgs.length -1;
imgs.css('display', 'none');
imgs.eq(sliderIndex).css('display', '');
}
Не проверял, но работать должно.