Pagination in JS
<p>I would need tweak this Pagination in JS</p>

<p>As you can see from this sample</p>

<p><a href="http://jsfiddle.net/jfm9y/" rel="nofollow">http://jsfiddle.net/jfm9y/</a></p>

<pre><code>pageSize = 3;
resultN = null;

showPage = function(page) {
    $(".content").hide();
    $(".content").each(function(n) {
        if (n &gt;= pageSize * (page - 1) &amp;&amp; n &lt; pageSize * page)
            $(this).show();
    });        
}

showPage(1);

$("#pagin li a").click(function() {
    $("#pagin li a").removeClass("current");
    $(this).addClass("current");
    showPage(parseInt($(this).text()))


});
</code></pre>

<p>On Page 1 a User can see div / 1 / 2 / 3 /</p>

<p>When a User click Page 2 the script show / 4 / 5 / 6 /</p>

<p>I would need change this script so when a User click Page 2 he would see / 2 / 3 / 4 /</p>

<p>and when clicking Page 3 he would see / 3 / 4 / 5 / and so on.</p>

<p>Could you point me out in the right direction?</p>

<p>EDIT - revised version (thanks to Kolink &amp; dencey)</p>

<p><a href="http://jsfiddle.net/jfm9y/89/" rel="nofollow">http://jsfiddle.net/jfm9y/89/</a></p>

<hr>

<pre><code>    var pageSize = 3;

var showPage = function(page) {
    $(".content").hide();
    $(".content").each(function(n) {
        if (n &gt;= (page - 1) &amp;&amp; n &lt; (page - 1) + pageSize)
            $(this).show();
    });        
}

showPage(1);

$("#pagin li a").click(function() {
    $("#pagin li a").removeClass("current");
    $(this).addClass("current");
    showPage(parseInt($(this).text())) 
});
</code></pre>

<p>​</p>
