静态页面如何用js分页 我有一个静态页面html,里面有1000多条记录,怎么用js来静态分页呢? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 //客户端分页var currPage = 1;var page = { ListBody:function(){ var obj = null; if($("listBody") != null) { obj = $("listBody"); } else { obj = $("big_listBody"); } if(obj == null) { obj = $("fff"); } 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; }}; 你这是php代码吗?我要用的是html的分页 帮我看看下面代码哪错了::: addEventListener支持的问题 请教解释一下这条语句; 做在线编辑器遇到的问题 怎样把一个checkbox对象传递给函数? xml在FF中怎么使用? 我在网易申请的空间,怎么不让它显示它自动给加的广告? 怎样将alert或者confirm弹出的对话框中的字体变大些? 如何用两个单选按钮来控制一个文本框的“可写”与“不可写” js怎么播放序列帧动画 求教JS编写复制输入框中的NAME属性? 这种效果怎么实现呀
var currPage = 1;
var page = {
ListBody:function(){
var obj = null;
if($("listBody") != null)
{
obj = $("listBody");
}
else
{
obj = $("big_listBody");
}
if(obj == null)
{
obj = $("fff");
}
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;
}
};