Bootstrap based Paging plugin Bootstrap-paginator

Source: Internet
Author: User

The project used to pagination, spent some time to finish, summed up, hoping to make everyone less detours. The database is MySQL, using MySQL's limit Start,len

First download: Bootstrap-paginator JS plugin, Address:

And then on the page:

<div id= "pagination" ></div> var options = {currentpage:1,//Totalpages:10,   itemcontainerclass:function (type, page, current) {return (page = = current)?
	        Active ":" Pointer-cursor ";
	                Itemtexts:function (Type, page, current) {switch (type) {case "a":
	            Return "Home";
	            Case "prev": Return "previous Page";
	            Case "Next": Return "next Page";
	            Case ' last ': return ' end ';
	            Case "page": Return page;
	            }, Onpageclicked:function (e,originalevent,type,page) {e.stopimmediatepropagation ();
	            var currenttarget = $ (e.currenttarget);
	            var pages = Currenttarget.bootstrappaginator ("GetPages");
	            Ajax calling Settabledata (page); Currenttarget.bootsTrappaginator ("Show", page);
	        Updatepagesinfo ($ ("#totalRecord"). Val (), page);
	        }, Pageurl:function (type, page, current) {return "#";

}
	    }; $ (' #pagination '). Bootstrappaginator (options);

The values in options can be set dynamically, such as Options.totalpages = 20, depending on the query condition or the total number of records.

The effect is as follows:


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.