// $('.btn-close').click(function () { // $('.youtube-video').each(function () { // this.contentWindow.postMessage('{"event": "command", "func": "stopVideo", "args": ""}', '*'); // }); // }); // $('.closeplay').click(function () { // $('.youtube-video').each(function () { // this.contentWindow.postMessage('{"event": "command", "func": "stopVideo", "args": ""}', '*'); // }); // }); $(document).on("click", ".btn-close", function (event) { $('.youtube-video').each(function () { this.contentWindow.postMessage('{"event": "command", "func": "stopVideo", "args": ""}', '*'); }); console.log('stop'); }); $(document).on("click", "#exampleModal", function (event) { $('.youtube-video').each(function () { this.contentWindow.postMessage('{"event": "command", "func": "stopVideo", "args": ""}', '*'); }); // alert('111111') // window.location.reload(); });