Created
July 6, 2017 00:51
-
-
Save royce002/b0720dcabe429849d661b064071438c5 to your computer and use it in GitHub Desktop.
Closes an iframe video on modal close
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var $frame = $('iframe#yourIframeId'); | |
// saves the current iframe source | |
var vidsrc = $frame.attr('src'); | |
// sets the source to nothing, stopping the video | |
$frame.attr('src',''); | |
// sets it back to the correct link so that it reloads immediately on the next window open | |
$frame.attr('src', vidsrc); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment