title: Each li different action
body: <p>I'm trying to build my own little (full page jquery slider) and I'm trying to figure out how to do the navigation but I don't seem to be able to fix it.</p>
  
  <p>I have a variable that stores the current width of the window and resizes it if that's needed. </p>
  
  <pre><code>var lastWidth   = $(window).width();
  $(window).resize(function(){
      if($(window).width()!=lastWidth){
  
          //execute code.
      }
  });
  </code></pre>
  
  <p>My navigation is a simple list of 3 items. </p>
  
  <pre><code>&lt;h1&gt;Home&lt;/h1&gt;
  &lt;ul&gt;
      &lt;li&gt;Portfolio&lt;/li&gt;
      &lt;li&gt;Blog&lt;/li&gt;
      &lt;li&gt;Contact&lt;/li&gt;
  &lt;/ul&gt;
  
  &lt;div id="pageslider"&gt;
      &lt;div id="home"&gt;Home content&lt;/div&gt;
      &lt;div id="portfolio"&gt;Portfolio content&lt;/div&gt;
      &lt;div id="blog"&gt;Blog content&lt;/div&gt;
      &lt;div id="contact"&gt;Contact content&lt;/div&gt;
  &lt;div&gt;
  </code></pre>
  
  <p>This is the code that gives the right value to my #sliderpage</p>
  
  <pre><code>$("#pageslider").css({"min-width": (lastWidth * 4)});
  </code></pre>
  
  <p>So my idea is this, I make a variable in which I store the lastWidth * 1 , * 2 , * 3. </p>
  
  <pre><code>var scrollWidth = [(-lastWidth * 1),-lastWidth * 2,-lastWidth * 3]
  </code></pre>
  
  <p>Then if I can link the first li with the first value in that variable I have the right amount of margin needed.</p>
  
  <p>But obviously I can't figure out how to do that, and this feels really convoluted</p>
  
  <p>Currently I use this code as my click function:</p>
  
  <pre><code>$('li').click(function(){
      $('li').each(function(i) {
          $('body').find('#pageslider').animate({
          "margin-left":scrollWidth[i]},1800,
          'easeInOutQuint');
      });
  });
  </code></pre>
  
  <p>This obviously does not work, it does react to the click but it does not care on what LI. Also it runs all the values from scrollWidth.</p>
  
  <p><strong>Here is a small jsFiddle of my current set up : <a href="http://jsfiddle.net/L29pq/49/" rel="nofollow">http://jsfiddle.net/L29pq/49/</a></strong></p>