jquery:simple pagination solution needed
i have this code i cannt complete;
<div class=paginatme></div>
<div class=paginatme></div>
<div class=paginatme></div>
<div class=paginatme></div>
<div class=paginatme></div>
<div class=paginatme></div>
<div class=paginatme></div>
<div class=paginatme></div>
<div class=paginatme></div>
<input type=hidden value=1 id=current_sh开发者_StackOverflow中文版own onchange='functioN(this.value)'>
<a href=''>Next</a><a href=''>previous</a>
<script>
functionN(x){
///CODE THAT SHOW div number X and 2 after and hide all..
}
</script>
i want to to add style=display:none to all and show them 3 by 3 on ahref click.
how can i count elements and give them style and none to rest ??
functionN(x){
$(".paginatme").hide();
$(".paginatme:eq("+x+")").show();
if (x == 8) x = -1;
x++;
$("#current_shown").val(x);
}
use .toggle() to switch on\off visibility of objects
精彩评论