title: Timing Fade in Order UsingJquery
body: <p>What I'm trying to do is the following:</p>
  
  <ol>
  <li>When the user clicks a trigger, an overlay comes on the screen <em>(this is working)</em></li>
  <li>after the overlay fades in, I want to be able to control the delay time before the list items of a UL fade in</li>
  <li>Once the list items complete their fade in, I want to trigger two other elements to fade in on the page</li>
  </ol>
  
  <p>Right now I've just got it to the point where the <code>list-items</code> fadeIn, but I don't know how to control the time prior to their fade in. </p>
  
  <p>Can anyone help?</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() {
    var square = $('.square');
    var ocn = $('.off-canvas-nav');
    var flag = false;
  
    square.click(function() {
      ocn.addClass('showOCN');
      flag = true;
      $(".mainNav li").each(function(i) {
        $(this).delay(300 * i).fadeIn(1000);
      });
    });
  });</code></pre>
  <pre class="snippet-code-css lang-css prettyprint-override"><code>* {
    padding: 0;
    margin: 0;
  }
  
  .container {
    height: 100%;
    width: 100%;
    position: relative;
  }
  
  .page {
    border: 1px solid;
    width: 90%;
    height: 90%;
    min-height: 500px;
  }
  
  .square {
    height: 40px;
    width: 40px;
    position: relative;
    left: 50px;
    top: 10px;
    background-color: #444;
    cursor: pointer;
  }
  
  .off-canvas-nav {
    position: absolute;
    height: 100%;
    width: 100%;
    background: rgba(0, 0, 0, .6);
    top: 0;
    left: 0;
    opacity: 0;
    z-index: -1;
    transition: all .3s ease;
  }
  
  .showOCN {
    opacity: 1;
    z-index: 2;
  }
  
  .mainNav {
    list-style-type: none;
    left: 20%;
    top: 50px;
    position: relative;
  }
  
  .mainNav&gt;li {
    margin: 30px 0px;
    display: none;
  }</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;div class="container"&gt;
    &lt;div class="page"&gt;
      &lt;div class="square"&gt;&lt;/div&gt;
    &lt;/div&gt;
    &lt;div class="off-canvas-nav"&gt;
      &lt;ul class="mainNav"&gt;
        &lt;li class=".fadeMe"&gt;Items&lt;/li&gt;
        &lt;li class=".fadeMe"&gt;Items&lt;/li&gt;
        &lt;li class=".fadeMe"&gt;Items&lt;/li&gt;
        &lt;li class=".fadeMe"&gt;Items&lt;/li&gt;
        &lt;li class=".fadeMe"&gt;Items&lt;/li&gt;
      &lt;/ul&gt;
    &lt;/div&gt;
  &lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>