title: jQuery hide only if visible, show only if hidden
body: <p>When using jQuery, is it possible to hide a <code>div</code> only if it is not hidden, and show it only if it is not shown, instead of adding the same classes to it again? </p>
  
  <p>Can something like an if be used there?</p>
  
  <p><strong>Eg:</strong></p>
  
  <pre><code>$(document).ready(function() {
   $(".trigger").click(function() {
      // Hide it but only if not hidden - hide
      // Later in the script - Show it but only If it's not visible. 
   });
  });
  
  &lt;div class="user"&gt;Example Div&lt;/div&gt; 
  &lt;div class="trigger"&gt;Load&lt;/div&gt;
  </code></pre>
  
  <p>I've stripped things down for this question. The real thing is a lot different.</p>
  
  <p><strong>Edit</strong></p>
  
  <p>Toggle is not what I'm trying to do. Toggle will change a class. I'm compulsorily trying to hide it, but only if it's not hidden. That is: add the hidden class only if it's current class is not hidden.</p>
  
  <pre><code>If class != 'hidden' then add the Hidden class
  </code></pre>