title: JQuery: detect which span id has class="active" and if button is pressed go to another span id
body: <p>I've got already one script that is toggling between every of span ids i've listed below adding class active and removing it so only 1 span id element is visible.</p>
  
  <pre><code>&lt;div id="b_pager"&gt;
  &lt;span id="p1" class="active"&gt;&lt;/span&gt;
  &lt;span id="p2"&gt;&lt;/span&gt;
  &lt;span id="p3"&gt;&lt;/span&gt;
  &lt;span id="p4"&gt;&lt;/span&gt;
  &lt;span id="p5"&gt;&lt;/span&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>Now what i want to do, is make two buttons (sort of arrows) that will allow to navigate throught span ids. </p>
  
  <p>Example: 
  If span id p3 is visible and arrow right -> is pressed automatically go to span id p4. If pressed arrow left &lt;- go back to p3, and so on. </p>
  
  <p>Any one can help? Thanks in advance.</p>
  
  <p>Matt</p>