<a href='#' class='slide-1 num'>1</a>
<a href='#' class='slide-2 num'>2</a>
<a href='#' class='slide-3 num'>3</a>
$('.num').click(function(){
var index = $('.num').index($(this));
gotoSlide(index);
return false;
});
function gotoSlide(i){
var currentSlide=i;
if(currentSlide>=$('.slidewrapper').children().size())
{
currentSlide=0;
}
$('.slidewrapper').animate({left: -currentSlide*slideWidth},300).data('current',currentSlide);
return false;
}