Created
September 13, 2019 20:20
-
-
Save jbd91/013d15290a17128cae9c1f59ec2f6401 to your computer and use it in GitHub Desktop.
Stop YT video sounds after modal closed
This file contains hidden or 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
// This was originally for a bootstrap modal | |
$(document).ready(function(){ | |
$('.modal').each(function(){ | |
var src = $(this).find('iframe').attr('src'); | |
$(this).on('click', function(){ | |
$(this).find('iframe').attr('src', ''); | |
$(this).find('iframe').attr('src', src); | |
}); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment