title: How to make thumbnails slide show only the thumbnails pic
body: <p>I need to make some simple JavaScript gallery with Thumbnail slider.</p>
  
  <p>I made the slider and when I click on the left or the right arrow the margin-right change and add or remove 570px. But I want to make it better, and when the gallery loads, cancel the Scroll right option because there's actually pictures, the same also for last images.</p>
  
  <p>HTML Structure look like this:</p>
  
  <pre><code>&lt;div class="tumbNavigation"&gt;
      &lt;div class="right_nav"&gt;&lt;/div&gt;
      &lt;div class="thumbnails"&gt;
          &lt;div class="thumbnailsWrapper"&gt;
              &lt;div class="thumbItem"&gt;&lt;/div&gt;
              &lt;div class="thumbItem"&gt;&lt;/div&gt;
              &lt;div class="thumbItem"&gt;&lt;/div&gt;
              &lt;div class="thumbItem"&gt;&lt;/div&gt;
              &lt;div class="thumbItem"&gt;&lt;/div&gt;
              &lt;div class="thumbItem"&gt;&lt;/div&gt;
              &lt;div class="thumbItem"&gt;&lt;/div&gt;
              &lt;div class="thumbItem"&gt;&lt;/div&gt;
              &lt;div class="thumbItem"&gt;&lt;/div&gt;
              &lt;div class="thumbItem"&gt;&lt;/div&gt;
              &lt;div class="thumbItem"&gt;&lt;/div&gt;
              &lt;div class="thumbItem"&gt;&lt;/div&gt;
          &lt;/div&gt;
      &lt;/div&gt;
      &lt;div class="left_nav"&gt;&lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>JavaScript code look like this:</p>
  
  <pre><code>        var pos = 0;
          var width = 570;
    $('.left_nav').click(function(){
          pos = pos - width;
          $('.thumbnailsWrapper').stop(true).animate({ marginRight: pos + "px"}, 500);
      });
  
    $('.right_nav').click(function(){
  
          pos = pos + width;
          $('.thumbnailsWrapper').stop(true).animate({ marginRight: pos + "px"}, 500);
      });
  </code></pre>