title: Autoplay youtube video when video appears in a certain container
body: <pre><code>&lt;div class="lightbox-trigger"&gt;&lt;/div&gt;
  
  &lt;div class="lightbox-content autoplay"&gt;&lt;iframe&gt;...&lt;/iframe&gt;&lt;/div&gt;
  
  &lt;div class="mfp-wrap"&gt;&lt;/div&gt;
  </code></pre>
  
  <p>I have <code>.lightbox-trigger</code> that when clicked opens up <code>.lightbox-content</code> inside <code>.mfp-wrap</code>. By default, the <code>.lightbox-content</code> is hidden, and will only be visible once it is inside <code>.mfp-wrap</code></p>
  
  <p>When there is a YouTube video inside <code>.lightbox-content.autoplay</code>, I'd like for the video to autoplay once the video appears in <code>.mfp-wrap</code>.</p>
  
  <p>I hope this makes sense. I tried this jQuery but it's not working for me...</p>
  
  <pre><code>$(".lightbox-trigger").click(function() { 
      $(".mfp-wrap .lightbox-content.autoplay iframe").attr("src").replace("?", "?autoplay=1&amp;"); 
  });
  </code></pre>