小编Jam*_*mes的帖子

如何使用jQuery prettyPhoto显示视频,并在点击的灯箱中打开?

我正在尝试使用prettyPhoto for jQuery将视频添加到我的网站.

我确实在我的头脑中添加了jQuery源代码和prettyPhoto js位置,并在我的body标签结束之前,我还添加了初始化代码(如文档中所述).

   <script type="text/javascript" charset="utf-8">
      $(document).ready(function(){
        $("a[rel^='prettyPhoto']").prettyPhoto();
      });
    </script>
Run Code Online (Sandbox Code Playgroud)

在我的HTML中,这就是我写的内容,因为我想要显示视频,但当有人点击它时,视频应该打开为灯箱.

<div id="video_player">
<a href="#" rel="prettyPhoto">
<iframe width="640" height="350" src="http://www.youtube.com/embed/cH6kxtzovew"  frameborder="0" allowfullscreen></iframe>
</a>
</div>
Run Code Online (Sandbox Code Playgroud)

但它不起作用.我该如何实现这一目标?

jquery lightbox prettyphoto

7
推荐指数
1
解决办法
3万
查看次数

标签 统计

jquery ×1

lightbox ×1

prettyphoto ×1