jquery Paging Control Features

Source: Internet
Author: User

Page out
<script>

        function getpagenum (num)  {             $ ("#PageNum  ul"). Empty ();             var AllCount = num;             var total = math.ceil (AllCount / 5);  / /data can be divided by the number of pages             $ ("#txtAll"). Val (total);             for  (var i = 1; i  < total + 1; i++)  {                 var html =  "<li><a>"  + i +   "</a></li>";                 $ ("#PagEnum ul "). Append (HTML);            }             var totalcount = math.ceil ( TOTAL&NBSP;/&NBSP;8);//page             var per eight pages  current = 1;            $ ("# PAGENUM&NBSP;UL&NBSP;LI:GT (7) "). Hide ();             $ ("#btnPrev"). attr ("Disabled",  "Disabled"). Click (function  ()  {                 $ ("#btnNext"). Removeattr ("Disabled");                 current - = 1;                $ ("# Pagenum ul li "). Hide ();                 var  indexstart =  (current - 1)  * 7;                 var indexEnd = indexStart + 7;                 $ ("  #PageNum  ul li "). Hide (). Slice (Indexstart, indexend). Show ();                 if  (current == 1)  $ (this). attr (" Disabled ", " disabled ");             });             $ ("#btnNext"). Click (function  ()  {                $ ("# Btnprev "). Removeattr (" disabled ");                current +=  1;                $ ("# Pagenum ul li "). Hide ();                 //$ ("#PageNum  ul li"). Show ();                 var indexStart =  (current - 1)  * 7;                 var indexend = current * 7 - 1 > $ ("#PageNum  ul  li "). length - 1 ? $ (" #PageNum  ul li ") .length - 1 :  current * 7 - 1;                 $ ("  #PageNum &Nbsp;ul li "). Hide (). Slice (indexstart, indexend+1). Show ();                // $ ("#PageNum  ul li:lt ("  +  indexstart +  "),  li:gt ("  + indexEnd +  ")",  $ ("#PageNum  ul")). Hide ();                if  ( Current == total)  $ (this). attr ("Disabled",  "disabled");             });             $ ("#PageNum  ul li"). Click ( function  ()  { //Click Digital                  var index = $ (This). Index ();                 getpagecurrent (index);             })              $ ("#btnConfirm"). Click (function  ()  {                 var index = $ ("#txtIndex"). Val ();                 getpagecurrent (Index  - 1),             })          }        function getpagecurrent ( Index)  {//index is the indexed value for the page you want to query             var  indexStart = index * 5;             var indexEnd = indexStart + 5;              $ ("  #thumbWrap_controlID  ul li"). Hide (). Slice (Indexstart, indexend). Show ();         }
</script>


HTML code:
 <div class= "products_contents"  id= "Product" >                 <div class= "Thumbwrap" >                     

JQuery Paging Control features

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.