Answer the question
In order to leave comments, you need to log in
How to turn off youtube video when modal closes?
https://jsfiddle.net/yo7j2eo6/
Actually, if you turn on the video and then close the modal window, the video will continue to play. What to add to stop the video?
This implementation is of interest, without connecting third-party scripts
Answer the question
In order to leave comments, you need to log in
You can simply remove the iframe and insert it when needed.
In Jquery, you can remove an element using the - remove ()
function.
And add an element with append ()
That is, when you closed the window, you delete the iframe.
Here is an example of how an iframe is deleted https://jsfiddle.net/o0xusd7h/
You can not delete it, but change the src to empty.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question