Guidance needed for jQuery pagination
<p>Hi i am using jQuery pagination and presently it's looks like</p>

<pre><code>&lt;Prev 1 2 3 4 5 6 7 8 9 10 11 12 Next&gt;
</code></pre>

<p>instead of above i need similar like this  </p>

<p><code>&lt;Prev 1 2 3 . . . 11 12 Next&gt;</code></p>

<p><code>&lt;Prev 3 4 5 . . . 11 12 Next&gt;</code></p>

<p><code>&lt;Prev 5 6 7 . . . 11 12 Next&gt;</code></p>

<p>finally</p>

<p><code>&lt;Prev 1 . . . . 10 11 12 Next&gt;</code></p>

<p>Here is my corresponding code to understand the situation </p>

<pre><code>var PerPage = 15;
var NumberOfItems = 180; //from db
var NumberOfPages = Math.ceil(NumberOfItems / PerPage);

 // to create Prev link
 var NavigationHtml = '&lt;li class="previous"&gt;&lt;a href="javascript:previous_history_trades();"&gt;&lt;span&gt;&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;';
   var CurrentLink = 0;

 // to create total page numbers link
    while (NumberOfPages &gt; CurrentLink) {
           NavigationHtml += '&lt;li class="history_trades_page_link" longdesc="' + CurrentLink + '"&gt;&lt;a href="javascript:go_to_history_trades_page(' + CurrentLink + ')"&gt;' + (CurrentLink + 1) + '&lt;/a&gt;&lt;/li&gt;';
            CurrentLink++;

      }
     //to create next link
     NavigationHtml += '&lt;li class="next"&gt;&lt;a href="javascript:next_history_trades();"&gt;&lt;span&gt;&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;';
      $('#history_trades_page_navigation').html(NavigationHtml);
</code></pre>

<p>and html</p>

<pre><code>&lt;div class="pagination pagination-mini-r"&gt;
  &lt;ul id='history_trades_page_navigation'&gt;
  &lt;/ul&gt;
&lt;/div&gt;
</code></pre>

<p>How can i do this?</p>
