//给你个客户端分页的:
//客户端分页
var $ = function (el) {
return (typeof el == 'object')?el:document.getElementById(el) ;
};
var currPage = 1;
var page = {
ListBody:function(){
var obj = null;
if($("listBody") != null)
{
obj = $("listBody");
}
else
{
obj = $("big_listBody");
}
return obj;
},
disPage:function(){
for(var i=0;i<this.ListBody().childNodes.length-1;i++)
{
this.ListBody().childNodes(i).style.display = "none";
}
},
tab:function(cmd){
if(cmd == "pers")
{
if(currPage > 1)
{
this.disPage();
$("list"+(currPage-1)).style.display = "";
currPage--;
}
}
else if(cmd == "next")
{
if(currPage < this.ListBody().childNodes.length -1)
{
this.disPage();
$("list"+(currPage+1)).style.display = "";
currPage++;
}
}
$("next").disabled = true;
$("pers").disabled = true;
if(currPage < this.ListBody().childNodes.length -1)
{
$("next").disabled = false;
}
if(currPage > 1)
{
$("pers").disabled = false;
}
$("currCount").innerText = currPage;
}
};
//客户端分页
var $ = function (el) {
return (typeof el == 'object')?el:document.getElementById(el) ;
};
var currPage = 1;
var page = {
ListBody:function(){
var obj = null;
if($("listBody") != null)
{
obj = $("listBody");
}
else
{
obj = $("big_listBody");
}
return obj;
},
disPage:function(){
for(var i=0;i<this.ListBody().childNodes.length-1;i++)
{
this.ListBody().childNodes(i).style.display = "none";
}
},
tab:function(cmd){
if(cmd == "pers")
{
if(currPage > 1)
{
this.disPage();
$("list"+(currPage-1)).style.display = "";
currPage--;
}
}
else if(cmd == "next")
{
if(currPage < this.ListBody().childNodes.length -1)
{
this.disPage();
$("list"+(currPage+1)).style.display = "";
currPage++;
}
}
$("next").disabled = true;
$("pers").disabled = true;
if(currPage < this.ListBody().childNodes.length -1)
{
$("next").disabled = false;
}
if(currPage > 1)
{
$("pers").disabled = false;
}
$("currCount").innerText = currPage;
}
};
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货