Popup to show youtube video inside iframe
javascript, jquery
Solution
HTML
<a class="popup" href="#!" data-link="http://www.youtube.com/embed/fbVD32w1oTo?enablejsapi=1" data-title="How to install SASS">SASS</a>
<a class="popup" href="#!" data-link="http://www.youtube.com/embed/Q0HFBy2BtfA?enablejsapi=1" data-title="How to install Node.js">Node.js</a>
<div id="video-view">
</div>
JQuery
$(".popup").click(function () {
var $this = $(this);
var $iframe = $("<iframe>").attr("src", $this.data("link")).css({"width": 400, "height": 300});
var $title = $("<h1>").text($this.data("title"));
$("#video-view").html($title).append($iframe);
$iframe.wrap("<div class='class-video'>");
});
JSFiddle
http://jsfiddle.net/ergec/BrW5w/
Problem
Please, help me realize this function! When clicked, a popup container, where load title and iframe (video from Youtube). Any ideas? Maybe there are plugins? ``` <a id="popup" href=""></a> <a id="popup" href=""></a> <div id="video-view"> <h1>title</h3> <iframe ... ></iframe> </div> ``` P.S. Sorry for my English =)