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; }
})