Home > php教程 > php手册 > thinkphp3.2原创ajax分页

thinkphp3.2原创ajax分页

WBOY
Release: 2016-06-07 11:39:17
Original
1330 people have browsed it

thinkphp3.2无刷新分页代码,有讲解,有演示,有下载,刚学php的都会了...
程序代码,和tp官网的程序代码一样 比如:$Page = new \Think\PageAjax($count, 10);主要是把分页条显示出来;
主要工作原理是把官网的分页里面的链接去除,然后在每个分页按钮上面加分页属性:data-page,根据这个参数值来获取对应的数据。
以下代码是借鉴素材火 (http://www.sucaihuo.com)的评论分页来做演示。var totalnum = $("#detail-page").attr("data-totalnum"); //分页数量<br> $("#detail-page").children("a").click(function() {<br>     var page = parseInt($(this).attr("data-page"));<br>     $.get(getUrl("Box/comments"), {<br>         page: page,<br>         totalnum: totalnum<br>     },<br>     function(data) {<br>         $("#comment_list").html(data);<br>     })<br> })若是你还不能明白,可以先看下 PHP+AJAX 无刷新分页教程,里面也有演示,也可下载;讲解的很到位,透露下网页特效无刷新分页教程:
http://www.sucaihuo.com/js/2.html

附件 PageAjax.class.rar ( 1.86 KB 下载:761 次 )

AD:真正免费,域名+虚机+企业邮箱=0元

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template