title: Changing css with jquery on click not restoring object's original css
body: <p>First of all, thank you to anyone who takes the time to look at this.
  Second, apologies if this is elementary stuff.
  Anyway here's the issue:
  On the menu page of my portfolio site (<a href="http://www.henrykember.com" rel="nofollow noreferrer">www.henrykember.com</a>), there are buttons that hide and reshuffle item thumbnails based on whether they're day-to-day work (&quot;9-5&quot;) or side projects (&quot;5-9&quot;). To show everything again, you click &quot;all&quot;.
  Clicking these buttons changes the css (&quot;margin-top&quot;, margin-left&quot;), so &quot;5-9&quot; items that are normally further down the page come up to the top when all the &quot;9-5&quot; stuff is hidden.
  But there's a glitch: when clicking &quot;5-9&quot;, then &quot;all&quot; (in that specific order), someo of the &quot;5-9&quot; items don't return to their original css.
  These aren't actual buttons, just clickable list items. Is that a problem?
  Here's my js:</p>
  <p>$(document).ready(function() {</p>
  <pre><code>var fivetonine = $(&quot;#fivetonine&quot;);
      var ninetofive = $(&quot;#ninetofive&quot;);
      var all = $(&quot;#all&quot;);
      var business = $(&quot;.business&quot;);
      var casual = $(&quot;.casual&quot;);
  
              fivetonine.on('click', function ()  {   
          casual.show(200);
          business.hide(200);
          $(&quot;a#subsub&quot;).css(&quot;margin-top&quot;, &quot;200px&quot;); 
          $(&quot;a#housework&quot;).css(&quot;margin-top&quot;, &quot;160px&quot;);
      });
  
      fivetonine.off('click', function ()  {
          business.show(200);
          casual.show(200);
  
      });
      
      ninetofive.on('click', function ()  {
          business.show(200);
          casual.hide(200);
          $(&quot;a#archive&quot;).css(&quot;margin-top&quot;, &quot;500px&quot;);
          $(&quot;a#subsub&quot;).css(&quot;margin-top&quot;, &quot;930px&quot;);
          $(&quot;a#housework&quot;).css(&quot;margin-top&quot;, &quot;1170px&quot;);
      });
  
  
      ninetofive.off('click', function ()  {
          business.show(200);
          casual.show(200);
      });
  
      all.on('click', function ()  {
          business.show(200);
          casual.show(200);
          $(&quot;a#subsub&quot;).css(&quot;margin-top&quot;, &quot;930px !important&quot;);
          $(&quot;a#housework&quot;).css(&quot;margin-top&quot;, &quot;1170px&quot;);
          $(&quot;a#archive&quot;).css(&quot;margin-top&quot;, &quot;1790px&quot;);
      });
  
      all.off('click', function ()  {
          business.show(200);
          casual.show(200);
      });
  </code></pre>
  <p>});</p>