静态页面如何用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的分页 求助:JS 无法显示图片 父页面_子页面 跨域问题 数字分组 关于编辑器的js取值问题 javascript 用table rows 取值的问题 急求一参数校验JS 关于日历插件 弹出窗口又返回值的。 火狐下的一段JS报错ReferenceError: event is not defined,晚上其他方法试了不好用 想做一个不符合条件提交按钮时灰色的 按不了 求教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;
}
};