title: CSS Transitions swap function
body: <p>I am using CSS transitions to make a slide out panel. I am using Javascript to fire to animation like so;</p>
  
  <pre><code>function slidein()
      {
      document.getElementById('container').className = 'slidein';
      }
  
      function slideout()
      {
      document.getElementById('container').className = 'slideout';
      }
  
  &lt;div onclick="slideout()"&gt;Click&lt;/div&gt; 
  </code></pre>
  
  <p>What I need to know is once I have fired the first function how can I swap the function so the user can then close the panel.</p>