Js:
The index=0;
$(function () {
Var $yy=$(" yy ");
$yy. Get (1). The innerHTML=1;
Var $classify=$(". The classify ");
$the classify. Get (0). The style="display: block";
$the classify. Get (1). Style="display: none;"
$the classify. Get (2) style="display: none;"
$the classify. Get (3). Style="display: none;"
Var $yy=$(" yy "). The get (4). The innerHTML=arr. Length;
});
The function changePage (I) {
The index=I;
The console. The info (index);
/* alert (index); */
If (index==4) {
Alert (" has reached the last page!" );
}
If (index & lt; 0 {
The index=0;
}
If (index & gt; 3) {
The index=3;
}
Var $classify=$(". The classify ");
Var $next1=$(" next ".) get (0). The value;
$next1=arr [index];
Var $next2=$(" next ".) get (1). The value;
$next2=arr [index];
Var $yy=$(" yy "). The get (1);
The switch (index) {
Case 0:
$the classify. Get (index). Style="display: block";
$the classify. Get (index + 1). Style="display: none;"
$the classify. Get (index + 2). Style="display: none;"
$the classify. Get (index + 3). Style="display: none;"
$yy. InnerHTML=index + 1;
break;
Case 1:
$the classify. Get (index - 1). Style="display: none;"
$the classify. Get (index). Style="display: block";
$the classify. Get (index + 1). Style="display: none;"
$the classify. Get (index + 2). Style="display: none;"
$yy. InnerHTML=index + 1;
break;
Case 2:
$classify. Get (index - 2) style="display: none;"
$the classify. Get (index - 1). Style="display: none;"
$the classify. Get (index). Style="display: block";
$the classify. Get (index + 1). Style="display: none;"
$yy. InnerHTML=index + 1;
break;
Case 3:
$the classify. Get (index - 3). The style="display: none;"
$classify. Get (index - 2) style="display: none;"
$the classify. Get (index - 1). Style="display: none;"
$the classify. Get (index). Style="display: block";
$yy. InnerHTML=index + 1;
break;
}
}
HTML:
Poetry column