$(".pageinfo li").bind("click",function(){
var $this = $(this);
if($this.is(":first-child")){
pagelist(0);
//获取a标签并添加样式
$this.next().next().find("a").addClass("current");
}else if($this.children().attr("class")=="prev"){
var current1 = $(".current").attr("id");
if(current1!=0){
//调用分页方法
pagelist(current1-1);
//获取前一个a标签的值
//var item1 = $(".pageinfo li a.hello").eq(current1-2).text();
//添加样式
$(".pageinfo li").find("[id="+(current1-1)+"]").addClass("current");
}
}else if($this.children().attr("class")=="next"){
var current = $(".current").attr("id");
var las_number = Number(current) + 1;
if(las_number!=page){
//调用分页方法
pagelist(las_number);
//获取前一个a标签的值
//var item1 = $(".pageinfo li a.hello").eq(current1).text();
//添加样式
$(".pageinfo li").find("[id="+las_number+"]").addClass("current");
}
}else if($this.is(":last-child")){
pagelist(page-1);
//获取a标签并添加样式
$this.prev().prev().find("a").addClass("current");
} else{
pagelist($this.children().attr("id"));
//获取a标签并添加样式
$this.find("a").addClass("current");
}
});
var $this = $(this);
if($this.is(":first-child")){
pagelist(0);
//获取a标签并添加样式
$this.next().next().find("a").addClass("current");
}else if($this.children().attr("class")=="prev"){
var current1 = $(".current").attr("id");
if(current1!=0){
//调用分页方法
pagelist(current1-1);
//获取前一个a标签的值
//var item1 = $(".pageinfo li a.hello").eq(current1-2).text();
//添加样式
$(".pageinfo li").find("[id="+(current1-1)+"]").addClass("current");
}
}else if($this.children().attr("class")=="next"){
var current = $(".current").attr("id");
var las_number = Number(current) + 1;
if(las_number!=page){
//调用分页方法
pagelist(las_number);
//获取前一个a标签的值
//var item1 = $(".pageinfo li a.hello").eq(current1).text();
//添加样式
$(".pageinfo li").find("[id="+las_number+"]").addClass("current");
}
}else if($this.is(":last-child")){
pagelist(page-1);
//获取a标签并添加样式
$this.prev().prev().find("a").addClass("current");
} else{
pagelist($this.children().attr("id"));
//获取a标签并添加样式
$this.find("a").addClass("current");
}
});