Hello! Modal window on CSS. It has a built-in video. But when you close the video, it continues to play. How to turn off the video when you click on the close button.

Layout modal window.

<a href="#ModalOpen1"><img src='img/reviews/review1.png' alt=""/></a> <div id="ModalOpen1" class="Window"> <div><a href="#close" title="Закрыть" class="close"><span>X</span></a> <iframe width="790" height="444" src="http://www.youtube.com/embed/Dq9eLgyuD1k" allowfullscreen></iframe> </div> </div> 

Tell me how to implement this task?

  • remove the iframe for example. - zb '
  • also an option, but it does not suit me! - soledar10
  • 2
    very sorry! - zb '
  • delete, I would not advise. - ishidex2

2 answers 2

Maybe you should just replace src?

 document.getElementById('videoFrame').src = "not.found/404" 

When re-accessing the window, you can re-set the correct address.

  • Thank. I will try to implement. - soledar10
  • YES, CSS modal window !! - soledar10 6:26 pm
  • If you succeeded (and judging by your emotions, you succeeded), then I am glad :). - Alex18

The problem was solved by replacing the iframe with an object