title: Jquery hide first 12 elementes, show next 12 elements Previous and Next
body: <p>what i am trying to do is make the first 12 elements hidden and show the next 12 elements and reverse, its like a next page and previous page in a search result.</p>
  
  <p>Got this code from <a href="https://stackoverflow.com/questions/36289573/jquery-hide-first-12-elementes-show-next-12-elements">Jquery hide first 12 elementes, show next 12 elements</a></p>
  
  <p><a href="https://jsfiddle.net/3rk53h7L/1/" rel="nofollow noreferrer">DEMO</a></p>
  
  <pre><code>  &lt;div class="inner-content"&gt;
        &lt;div class="front-pro"&gt;151&lt;/div&gt;
        &lt;div class="front-pro"&gt;151&lt;/div&gt;
        &lt;div class="front-pro"&gt;151&lt;/div&gt;
        &lt;div class="front-pro"&gt;151&lt;/div&gt;
        &lt;div class="front-pro"&gt;151&lt;/div&gt;
        &lt;div class="front-pro"&gt;151&lt;/div&gt;
        &lt;div class="front-pro"&gt;151&lt;/div&gt;
        &lt;div class="front-pro"&gt;151&lt;/div&gt;
        &lt;div class="front-pro"&gt;151&lt;/div&gt;
        &lt;div class="front-pro"&gt;151&lt;/div&gt;
        &lt;div class="front-pro"&gt;151&lt;/div&gt;
        &lt;div class="front-pro"&gt;151&lt;/div&gt;
        &lt;div class="front-pro"&gt;152&lt;/div&gt;
        &lt;div class="front-pro"&gt;152&lt;/div&gt;
  etc...
      &lt;/div&gt;
  
      &lt;div&gt;next&lt;/div&gt;
  
      var x = $(".inner-content div").hide();
  
      $("div:contains(next)").click(function() {
        var cnt = $(this).data("cnt") || 0;
        if((cnt * 12) &gt; x.length){ cnt = 0; }
        x.hide().filter(":eq("+ (cnt * 12)  + "), :lt(" + ((cnt * 12) + 12) + "):gt(" + (cnt * 12) + ")").show();
        $(this).data("cnt", ++cnt);
      });
  </code></pre>
  
  <p>This code works but i want to reverse it with a previous button</p>