你今天脑子有点蒙了,就这个让我想了半天
瞬间无语了。。。。。
$(document).ready(function(){
$('.info-left').hide();
var len = $('.pageArea').length; //计算总个数;
var index = 0;
//右
$('.info-right').click(function(){
$('.info-left').fadeIn();
index++;
index==len-1?$('.info-right').fadeOut():index = index;
if(index >len-1){
index = len-1;
return false;
}
$('.pageArea').eq(index).fadeIn().siblings().hide();
})
//左
$('.info-left').click(function(){
$('.info-right').fadeIn();
index--;
index==0?$('.info-left').fadeOut():index = index;
if(index < 0){
index = 0;
return false;
}
$('.pageArea').eq(index).fadeIn().siblings().hide();
})
})