wordpress 微商网站,wordpress购物主题多大,湘潭做网站 m磐石网络,网络服务采购序言 这一款js分页使用起来很爽#xff0c;自己经常用#xff0c;做项目时总是要翻以前的项目看#xff0c;不方便#xff0c;这里就把他写出来方便自己以后粘帖#xff0c;也希望能分享给大家。友情提示下#xff1a;我有一片博客是用着个js实现的无刷新分页也很好用自己经常用做项目时总是要翻以前的项目看不方便这里就把他写出来方便自己以后粘帖也希望能分享给大家。友情提示下我有一片博客是用着个js实现的无刷新分页也很好用这篇写的不是无刷新分页链接地址为无刷新分页 jquery.pagination.js 参数说明 参数名描述参数值maxentries总条目数 必选参数整数items_per_page每页显示的条目数 可选参数默认是10num_display_entries连续分页主体部分显示的分页条目数 可选参数默认是10current_page当前选中的页面 可选参数默认是0表示第1页num_edge_entries两侧显示的首尾分页的条目数 可选参数默认是0link_to分页的链接 字符串可选参数默认是#prev_text“前一页”分页按钮上显示的文字 字符串参数可选默认是Prevnext_text“下一页”分页按钮上显示的文字 字符串参数可选默认是Nextellipse_text省略的页数用什么文字表示 可选字符串参数默认是…prev_show_always是否显示“前一页”分页按钮 布尔型可选参数默认为true即显示“前一页”按钮next_show_always是否显示“下一页”分页按钮 布尔型可选参数默认为true即显示“下一页”按钮callback回调函数 当点击链接的时候此函数被调用此函数接受两个参数新一页的id和pagination容器一个DOM元素。如果回调函数返回false则pagination事件停止执行插件代码 js代码 View Code css代码有好几款样式供你选择不错的 View Code 前端代码 script src../js/jquery.pagination.js typetext/javascript/scriptlink href../css/pagination.css relstylesheet typetext/css /script typetext/javascript$(function () {function pageselectCallback(page_id, jq) {//alert(page_id); 回调函数进一步使用请参阅说明文档}$(#Pagination).pagination(%pcount%, {callback: pageselectCallback,//PageCallback() 为翻页调用次函数。prev_text: 上一页,next_text: 下一页 ,items_per_page: %pagesize %, //每页的数据个数num_display_entries: 3, //两侧首尾分页条目数current_page: %page%, //当前页码num_edge_entries: 2, //连续分页主体部分分页条目数link_to:?page__id__});InterlacesColor(); //隔行换色(这个不是分页里面的js方法)});/scriptasp:Repeater IDRpt_UserList runatserverItemTemplate
trtd%# Eval(UserName)%/td /trItemTemplate/asp:Repeaterdiv idPagination classright flickr/div 后台代码 protected int pcount 0; //总条数protected int page 0; //当前页protected int pagesize 5; //设置每页显示的大小protected void Page_Load(object sender, EventArgs e){if (!int.TryParse(Request.Params[page] as string, out this.page)){page 0;}}#region 数据分页public void PageBind(string where,string order){ bll new UserAccount();ds new DataSet();pcount bll.GetPageCount(where);ds bll.GetDataByPage(page * pagesize,(page1)*pagesize,order,where); if (ds ! null ds.Tables[0].Rows.Count 0){Rpt_UserList.DataSource ds;Rpt_UserList.DataBind();}}#endregion 样式效果展示 div idPagination classflickr/div div idPagination classmeneame/div div idPagination classscott/div div idPagination classquotes/div div idPagination classblack/div 好了在此就不疼了自己用哪一款样式自己找吧css里面有好多不够用了自己也可以修改为自己喜欢的样式。 再次友情链接无刷新分页 jquery.pagination.js 补充 多参数问题 我的解决方案如下谁有更好的可以分享下。 $(function () {function pageselectCallback(page_id, jq) { TranUrl(page_id);}$(#Pagination).pagination(%pcount%, {callback: pageselectCallback,//PageCallback() 为翻页调用次函数。prev_text: 上一页,next_text: 下一页 ,items_per_page: %pagesize %, //每页的数据个数num_display_entries: 3, //两侧首尾分页条目数current_page: %page%, //当前页码num_edge_entries: 2, //连续分页主体部分分页条目数});//通过修改url来达到分页效果。function TranUrl(page_id){var urllocation.href;var star;if(url.indexOf(aspx?)0){if(url.indexOf(page)0){ starurl.indexOf(page);urlurl.substring(0,star);location.hrefurlpagepage_id;}else{location.hrefurlpagepage_id;}}else{location.hrefurl?pagepage_id;}}}); 转载于:https://www.cnblogs.com/h5monkey/p/5817211.html