当前位置: 首页 > 图文教程 > 网络编程 > Javascript > jquery 插件 web2.0分格的分页脚本,可用于ajax无刷新分页

Javascript
form中限制文本字节数js代码
use jscript with List Proxy Server Information
use jscript List Installed Software
List Installed Software Features
List Information About the Binary Files Used by an Application
List the Codec Files on a Computer
List the UTC Time on a Computer
List Installed Hot Fixes
excel操作之Add Data to a Spreadsheet Cell
Add Formatted Data to a Spreadsheet
Apply an AutoFormat to an Excel Spreadsheet
JavaScript语法着色引擎(demo及打包文件下载)
类之Prototype.js学习
一款JavaScript压缩工具:X2JSCompactor
iis6+javascript Add an Extension File
jscript之Open an Excel Spreadsheet
jscript之Read an Excel Spreadsheet
jscript之List Excel Color Values
去除图像或链接黑眼圈的两种方法总结
Add a Formatted Table to a Word Document

Javascript 中的 jquery 插件 web2.0分格的分页脚本,可用于ajax无刷新分页


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-09-12   浏览: 413 ::
收藏到网摘: n/a

displaynum,displaylastNum可以自由定制显示的页码数量 ******生成js分页脚******
****没剑(2008-03-05)****
修改日期:2008-3-12
添加两个参数:displaynum,displaylastNum可以自由定制显示的页码数量
参数: pagesize:10 //每页显示的页码数
,count:0 //数据条数
,css:"mj_pagefoot" //分页脚css样式类
,current:1 //当前页码
,displaynum:7 //中间显示页码数
,displaylastNum:5 //最后显示的页码数
,previous:"上一页" //上一页显示样式
,next:"下一页" //下一页显示样式
,paging:null //分页事件触发时callback函数
使用:
$("div").pagefoot({
pagesize:10,
count:500,
css:"mj_pagefoot",
previous:"<",
next:">",
paging:function(page){
alert("当前第"+page+"页");
}
});
以上代码为所有div加上分页脚代码
*/
其中要特别说明一下其中的一个参数:paging
1 这个参数为分页脚分页时触发的动作,如果你不在这个动作里加点东西的话,这个分页就不会正常动作,所以你可以这样子加入:
paging:function(page){
location.href="?page="+page;
}
当然这时你为了要保持分页的页码位置的话,就要在刷新页面时把当前页码赋给参数:current
了,如果你不赋值给它,它默认的值是第一页。。。
2 如果你加入一些load数据的动作的话就可以当成是ajax无刷新了,呵呵
paging:function(page){
//ajax.loaddata(page);
}
没有什么技术含量,权当练手吧,哈哈
复制代码 代码如下:

JackLee: paging:function(page){
location.href="?page="+page;
}
用这个有问题呀??
当你点了第10页时,在div导航上第1页是当前,我想应该让第10页是当前的才对呀!
--------------------------------------------------------
你没有注意这里哦:
---
当然这时你为了要保持分页的页码位置的话,就要在刷新页面时把当前页码赋给参数:current
了,如果你不赋值给它,它默认的值是第一页。。。
---
你在重新加载了这个页后要手动赋值给它。
如果你不想这样子的话就用ajax来分页效果会比较好,又不会太麻烦

在线演示 http://img.ruanchen.com/"http://img.ruanchen.com/" style="color: #000">http://img.ruanchen.com/nline/jquery.pageFoot/jquery.pageFoot.rar