Home >Web Front-end >JS Tutorial >jQuery front-end paging example sharing_jquery

jQuery front-end paging example sharing_jquery

WBOY
WBOYOriginal
2016-05-16 16:14:431403browse

When people do paging, most of them return an HTML string for the navigation bar in the background. In fact, it is also easy to implement using js on the front end.

Call the pager method, enter parameters, and an HTML string of the navigation bar will be returned. The internals of the method are relatively simple.

Copy code The code is as follows:

/**
* pageSize, number displayed per page
* pageIndex, current page number
* pageCount Total number of pages
* url connection address
* Example of using pager(10, 1, 5, 'Index')
*/
function pager(pageSize, pageIndex, pageCount, url) {
var intPage = 7; //Number display
var intBeginPage = 0;//Number of starting pages
var intEndPage = 0;//Ending page number
var intCrossPage = parseInt(intPage / 2); //Displayed number
var strPage = "";
}

Try this method

复制代码

http://www.w3.org/1999/xhtml">

   
   
   
   
   


   


       
           
               
               
               
               
               
               
               
               
               
               
               
           
       
       
   
CustomerIDCompanyNameContactNameContactTitleAddressCityRegionPostalCodeCountryPhoneFax

   



[/code]

看下效果

列有点多,我只截图了部分,界面好丑,加点样式,用bootstrap来美化下

使用Nuget安装bootstrap

加上样式后

虽说不是特别漂亮,但还是对得起观众吧。

代码下载https://github.com/dengjianjun/JsPager

如果觉得对你有帮助,请点个赞,谢谢!

Statement:
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