From 8069d17e69ebb6a1b209581d2a85a9f20729ecf5 Mon Sep 17 00:00:00 2001 From: nyanloutre Date: Wed, 19 Jul 2017 14:08:35 +0200 Subject: [PATCH] Bug fermeture popup youtube --- index.html | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/index.html b/index.html index cf3d10f..3e1d1a5 100644 --- a/index.html +++ b/index.html @@ -218,11 +218,11 @@ var button = $(event.relatedTarget); var youtube_id = button.data('youtubeid'); var modal = $(this); - modal.find('.modal-body iframe')[0].src = 'https://www.youtube.com/embed/' + youtube_id + "?modestbranding=1&rel=0&html5=1&autoplay=1"; - $('#youtubeModal' + ' button.close').click(function () { - $('#youtubeModal' + ' iframe').attr('src', ""); - }); - }) + modal.find('.modal-body iframe')[0].src = 'https://www.youtube.com/embed/' + youtube_id + "?modestbranding=1&rel=0&html5=1"; + }); + $('#youtubeModal').on('hidden.bs.modal', function () { + $(this).find('.modal-body iframe')[0].src = ""; + });