Вот как это сделать, используя jQuery.DIYslider , легкий и настраиваемый слайдер jQuery .
Демонстрация следующего кода: http://jsfiddle.net/bj4yZ/155/
Вы заметите, что этот плагин позволяет чрезвычайно легко делать все, что вы хотите.
Вы найдете все опции, методы и события этого плагина на странице, указанной выше.
HTML
<button id="go-left">«</button> <button id="go-right">»</button>
<div class="slider"><!-- The slider -->
<div><!-- A mandatory div used by the slider -->
<!-- Each div below is considered a slide -->
<div class="a">Div #1</div>
<div class="b">Div #2</div>
<div class="c">Div #3</div>
<div class="d">Div #4</div>
<div class="e">Div #5</div>
</div>
</div>
JavaScript
$(".slider").diyslider({
width: "400px", // width of the slider
height: "200px", // height of the slider
display: 3, // number of slides you want it to display at once
loop: false // disable looping on slides
}); // this is all you need!
// use buttons to change slide
$("#go-left").bind("click", function(){
// Go to the previous slide
$(".slider").diyslider("move", "back");
});
$("#go-right").bind("click", function(){
// Go to the previous slide
$(".slider").diyslider("move", "forth");
});