0
<div id="popup-box1" class="popup-position">  
    <div id="popup-wrapper">

      <p><a href="javascript:void(0)" id="close" onclick="toggle_visibility('popup-box1');"><img src="images/icon_x.png"></a></p>

      <iframe width="640" height="360" class="yvideo"src="https://www.youtube.com/embed/lQhkpmEd3Fo" frameborder="0" allowfullscreen></iframe>

    </div>
  </div>

I am trying to use jQuery to close as well as stop the YouTube video from playing. As it is now, I close the video popup, but the video / sound continues to play when the popup is closed. Thanks in advance for your help.

Ed Brooks
  • 43
  • 5

1 Answers1

0

Check out this similar question/answer:

Hide/show in JavaScript - stop playing YouTube iframe video

looks like adding ?enablejsapi=1 to your video requests will allow you to post play/stop commands to the iframe

Community
  • 1
  • 1
user1026361
  • 3,627
  • 3
  • 22
  • 20