title: javascript Welcome modal only disappears partially
body: <p>I have a modal window opening when the page loads.</p>
  
  <p>It opens well, however, when I close it, it does not disappear completely, as the grey body-background stays, plus the link in the back become disabled.</p>
  
  <p>I must have got something wrong in the code.</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>$(document).ready(function (){
    $('#modal-container').removeAttr('class').addClass('four');
    $('body').addClass('modal-active');
  })
  
  $('#modal-container').click(function(){
    $(this).addClass('out');
  });</code></pre>
  <pre class="snippet-code-css lang-css prettyprint-override"><code>html.modal-active, body.modal-active {
    overflow: hidden;
  }
  
  #modal-container {
    position: fixed;
    display: table;
    height: 100%;
    width: 100%;
    top: 0;
    left: 0;
    transform: scale(0);
    z-index: 5;
  }
  
  #modal-container.four {
    z-index: 4;
    transform: scale(1);
  }
  #modal-container.four .modal-background {
    background: rgba(0, 0, 0, 0.8);;
  }
  #modal-container.four .modal-background .modal {
    animation: blowUpModal 0.5s cubic-bezier(0.165, 0.84, 0.44, 1) forwards;
  }
  #modal-container.four + .content-formodal {
    z-index: 5;
    animation: blowUpContent 0.5s cubic-bezier(0.165, 0.84, 0.44, 1) forwards;
  }
  #modal-container.four.out .modal-background .modal {
    animation: blowUpModalTwo 0.5s cubic-bezier(0.165, 0.84, 0.44, 1) forwards;
  }
  #modal-container.four.out + .content-formodal {
    animation: blowUpContentTwo 0.5s cubic-bezier(0.165, 0.84, 0.44, 1) forwards;
  }
  
  #modal-container .modal-background {
    display: table-cell;
    background: rgba(0, 0, 0, 0.8);
    text-align: center;
    vertical-align: middle;
  }
  #modal-container .modal-background .modal {
    background: white;
    padding: 50px;
    display: inline-block;
    border-radius: 3px;
    font-weight: 300;
    position: relative;
  }
  #modal-container .modal-background .modal h2 {
    font-size: 25px;
    line-height: 25px;
    margin-bottom: 15px;
  }
  #modal-container .modal-background .modal p {
    font-size: 18px;
    line-height: 22px;
  }
  #modal-container .modal-background .modal .modal-svg {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 100%;
    border-radius: 3px;
  }
  #modal-container .modal-background .modal .modal-svg rect {
    stroke: #fff;
    stroke-width: 2px;
    stroke-dasharray: 778;
    stroke-dashoffset: 778;
  }
  
  
  @keyframes blowUpContent {
    0% {
      transform: scale(1);
      opacity: 1;
    }
    99.9% {
      transform: scale(2);
      opacity: 0;
    }
    100% {
      transform: scale(0);
    }
  }
  @keyframes blowUpContentTwo {
    0% {
      transform: scale(2);
      opacity: 0;
    }
    100% {
      transform: scale(1);
      opacity: 1;
    }
  }
  @keyframes blowUpModal {
    0% {
      transform: scale(0);
    }
    100% {
      transform: scale(1);
    }
  }
  @keyframes blowUpModalTwo {
    0% {
      transform: scale(1);
      opacity: 1;
    }
    100% {
      transform: scale(0);
      opacity: 0;
    }
  
  .linkclass {
  
    color: #283446;
    display: inline-block;
    font-size: 18px;
    text-transform: uppercase;
    font-family: 'geomanistregular';
    letter-spacing: 2.5px;
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"&gt;&lt;/script&gt;
  &lt;body style="background-color: white"&gt;
  
  &lt;div id="modal-container"&gt;
    &lt;div class="modal-background"&gt;
      &lt;div class="modal"&gt;
        &lt;h2&gt;I'm a Modal&lt;/h2&gt;
        &lt;p&gt;Hear me roar.&lt;/p&gt;
        &lt;svg class="modal-svg" xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" preserveAspectRatio="none"&gt;
                  &lt;rect x="0" y="0" fill="none" width="226" height="162" rx="3" ry="3"&gt;&lt;/rect&gt;
                &lt;/svg&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/div&gt;
  
  &lt;div class="content-formodal"&gt;
  
   &lt;a href="#"&gt;&lt;p class="linkclass"&gt;LINK&lt;/p&gt;&lt;/a&gt;   
  
  &lt;/div&gt; &lt;!-- content-formodal --&gt;
  
  &lt;/body&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>Basically, when I click anywhere, I would like the modal to disappear completely and leave room to everything else behind it. Right now, it is not the case.</p>
  
  <p>Please advise</p>