The advantages of the jquery paging effect

Source: Internet
Author: User
Tags array bind return

Advantages of the jquery paging effect

var total=$ (. Class). length; Gets the total number of elements that need to be paginated var radio=3;//according to the width screen to obtain the number of offer per page display: var pagesize=parseint (Total/radio);  
The total number of pages received; if (sum% radio!=0) {pagesize+=1;  } var currentpage=1;
   The current page is the first page//pages forward code: $ (. Leftarrow,parentelem). Bind (' click ', Function (e) {var index=currentpage-1;
   if (currentpage==1) {return;
      }else{$ (. Class). css (' Display ', ' none '); var Elemindex=index*radio;
        Pointer $ (. Class). EQ (elemindex). CSS (' Display ', ') for the element to be displayed at the beginning of the array.
        $ (. Class). EQ (elemindex+1). CSS (' Display ', ');
        $ (. Class). EQ (elemindex+2). CSS (' Display ', '); The above three lines can be rewritten as//$ (. Class). EQ (elemindex). CSS (' Display ', ')//. Next (). CSS (' Display ', ')/ /. Next ().     
    CSS (' Display ', ');
   Currentpage=index;
   )///Page Backward code: $ (. Rightarrow,parentelem). Bind (' click ', Function (e) {var index=currentpage+1;
   if (currentpage==pagesize) {return;
      }else{$ (. Class). css (' Display ', ' none '); var Elemindex=index*radio; The start of the array to display in theElement's pointer $ (. Class). EQ (elemindex). CSS (' Display ', ');
        $ (. Class). EQ (elemindex+1). CSS (' Display ', ');
       $ (. Class). EQ (elemindex+2). CSS (' Display ', '); The above three lines can be rewritten as//$ (. Class). EQ (elemindex). CSS (' Display ', ')//. Next (). CSS (' Display ', ')/ /. Next ().  
    CSS (' Display ', ');
   Currentpage=index; }
})


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.