From 27bf64b5b579a19e806061e6c8c7d356e93ca6ef Mon Sep 17 00:00:00 2001 From: nyanloutre Date: Mon, 17 Jul 2017 00:56:35 +0200 Subject: [PATCH] =?UTF-8?q?Fenetre=20modale=20vid=C3=A9o=20YouTube?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.html | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/index.html b/index.html index 3ad6559..d3ccd1b 100644 --- a/index.html +++ b/index.html @@ -131,7 +131,7 @@
-
+
@@ -160,6 +160,22 @@
+ + @@ -193,6 +209,15 @@ video_div.onmouseover = function() {this.children[0].play()}; video_div.onmouseout = function() {this.children[0].load()}; } + + $('#youtubeModal').on('show.bs.modal', function (event) { + var button = $(event.relatedTarget) // Button that triggered the modal + var youtube_id = button.data('youtubeid') // Extract info from data-* attributes + // If necessary, you could initiate an AJAX request here (and then do the updating in a callback). + // Update the modal's content. We'll use jQuery here, but you could use a data binding library or other methods instead. + var modal = $(this) + modal.find('.modal-body iframe')[0].src = 'https://www.youtube.com/embed/' + youtube_id + })