1

I have written the code...I want to open a youtube video in popup using iframe by clicking on the photo.below is the code i have written. I have written the code...I want to open a youtube video in popup using iframe by clicking on the photo.below is the code i have written.

<iDOCTYPE html>
<html>
    <head>
        <link rel="stylesheet" href="http://code.jquery.com/mobile/1.2.0/jquery.mobile-1.2.0.min.css" />
        <script src="http://code.jquery.com/jquery-1.8.2.min.js"></script>
        <script src="http://code.jquery.com/mobile/1.2.0/jquery.mobile-1.2.0.min.js"></script>

        <script></script>
    </head>

    <body>
        <div data-role="page" id="page1">
                <div data-role="div" id="div1"> 
                    <img src="image1.jpg" onclick="play()" width="200px" height="200px" id="Zu5XUbig5G0">   
                </div>
                    <div data-role="footer" data-position="fixed">
                        <a href="#popup2"><h4>Featured</h4></a>
                    </div>

        </div>

        <div data-role="popup" id="popup2" data-overlay-theme="a" data-theme="a" data-corners="false" data-tolerance="15,15">

                <script>
                    function play()
                    {
                    var vid=document.getElementById("div1").getElementsByTagName('img')[0].id;
                    //alert(vid);
                        {
                        alert(vid);
                       document.getElementById("popup2").innerHTML="<iframe src='http://www.youtube.com/embed/tyOy3kRzkcM' width='480' height='320' seamless='' id='plyerIframe1'></iframe>";
                        //alert(vid);
                        }   
                    }
                </script>                           



        </div>

    </body>

</html>
4

0 回答 0