Example 1
The core code is as follows
The code is as follows |
Copy Code |
$.ajax ({ Url:url, DataType: ' JSON ', Data:data, Success:callback }); |
You can refer to the jquery website Pai http://api.jquery.com/jQuery.getJSON/
The code is as follows |
Copy Code |
function Changepagination (pageid,liid) { $ (". Flash"). Show (); $ (". Flash"). FadeIn. html (' Loading '); var datastring = ' pageid= ' + PageID; $.ajax ({ Type: "POST", URL: "pagedata.php", Data:datastring, Cache:false, Success:function (Result) { $ (". Flash"). Hide (); $ (". Link a"). css (' Background-color ', ' #fff '); $ ("#" +liid+ "a"). css (' Background-color ', ' #99A607 '); $ ("#pageData"). HTML (result); } }); } |
Php_ajax_jquery paging source Download: Http://file.111cn.net/upload/2013/10/super_paging.rar
Example 2
I don't use frames for pagination
The internet to find a modified php_ajax_jquery paging, using the Load method
The code is as follows |
Copy Code |
function Showloader () { $ ('. Search-background '). FadeIn; } function Hideloader () { $ ('. Search-background '). fadeout; }; $ ("#paging_button li"). Click (function () { showloader (); $ ("#paging_button li"). css ({' Background-color ': '}); $ (this). css ({' Background-color ': ' #006699 '}); $ ("#content"). Load ("data.php?page=" + this.id, Hideloader); return false; }); $ ("#1"). css ({' Background-color ': ' #006699 '}); Showloader (); $ ("#content"). Load ("data.php?page=1", hideloader); }); |
P_a_jquery Paging: Http://file.111cn.net/upload/2013/10/p_aj_Pagination.rar
Example 3
Or use a Jqurey paging plugin
Just define a class and then modify the next argument
The code is as follows |
Copy Code |
$ ("ul.paging"). Quickpager (); $ ("Ul.paging2"). Quickpager ({pagerlocation: "both"}); (function ($) { $.fn.quickpager = function (options) { var defaults = { pagesize:2, currentpage:1, Holder:null, pagerlocation: "After" }; var options = $.extend (defaults, options); return This.each (function () { var selector = $ (this); var pagecounter = 1; selector.wrap ("<div class= ' Simplepagercontainer ' ></div>"); Selector.children (). each (function (i) { if (i < pagecounter*options.pagesize && i >= (pageCounter-1) *options.pagesize) { $ (this). addclass ("Simplepagerpage" +pagecounter); } else { $ (this). addclass ("Simplepagerpage" + (pagecounter+1)); PageCounter + +; } }); |
This example source download: Http://file.111cn.net/upload/2013/10/simplepager-master.rar