title: GSAP Javascript if else statement woes
body: <p>I'm building a basic online banking app with HTML, CSS, and JS.</p>
  
  <p>So far I have the recent transaction screen and a simple animation for opening each individual transaction's description.</p>
  
  <p>I used GSAP to create the animation, and jQuery for handling elements.</p>
  
  <p><strong>However, I have run into a problem getting the description window to close after it has been opened.</strong> </p>
  
  <p><a href="http://codepen.io/tnormington/pen/QbOPmX" rel="nofollow">CODEPEN HERE</a>, and here is the JS:</p>
  
  <pre><code>$(document).ready(function() {
    $('.list li').click(function() {
  
      var i = $(this).find('i');
      var li = $(this);
      var desc = $(this).next();
      var tl = new TimelineMax({paused:false});
      var open = false;
  
      if (open === true) {
        tl.to(i, .3, {rotation: 0})
          .to(li, .3, {borderBottom: 'none', delay: -.2})
          .to(desc, .3, {height: '0', padding: '0', delay: -.2});
        open = false;
      } else {
        tl.to(i, .3, {rotation: 90})
          .to(li, .3, {borderBottom: '2px solid #95a5a6', delay: -.2})
          .to(desc, .3, {height: '55px', padding: '5px', delay: -.2});
        open = true;
      }
  
  
    });
  
  
  });
  </code></pre>
  
  <p>I use an if statement to decide which animation to play depending on if the description window is open or closed.</p>
  
  <p>I am a designer learning to code, I will take any advice I can get.</p>