单击图像时,我需要显示youtube视频,它将youtube视频显示为新的弹出窗口。
这是我的代码:
<html>
<head>
<meta content="text/html; charset=UTF-8" http-equiv="content-type">
<title> - jsFiddle demo</title>
<script src="jquery-1.9.1.js" type="text/javascript"></script>
<script src="jquery-ui.js" type="text/javascript"> </script>
<link href="jquery-ui.css" type="text/css" rel="stylesheet">
<script src="youtubepopup.min.js" type="text/javascript">
</script>
<script type="text/javascript">
$(function(){
$("a.youtube").YouTubePopup({ autoplay: 0 });
});
</script>
</head>
<body>
<a class="youtube" href="http://www.youtube.com/watch?v=4eYSpIz2FjU" title="jQuery YouTube Popup Player Plugin TEST">Test Me</a>
</body>
</html>
当单击图像时,它没有任何改变。
谁能帮我?
谢谢!!!
最佳答案
试试这个
<html>
<head>
<meta content="text/html; charset=UTF-8" http-equiv="content-type">
<title> - jsFiddle demo</title>
<script src="//code.jquery.com/jquery-1.9.1.js" type="text/javascript"></script>
<script src="http://code.jquery.com/ui/1.9.2/jquery-ui.js" type="text/javascript"> </script>
<link href="http://code.jquery.com/ui/1.9.2/themes/base/jquery-ui.css" type="text/css" rel="stylesheet">
<script src="http://lab.abhinayrathore.com/jquery_youtube/jquery.youtubepopup.min.js" type="text/javascript">
</script>
<script type="text/javascript">
$(function(){
$("img.youtube").YouTubePopup({ idAttribute: 'id' ,'clickOutsideClose': true,});
});
</script>
</head>
<body>
<img id="4eYSpIz2FjU" class="youtube" title="..." src="http://img.youtube.com/vi/4eYSpIz2FjU/1.jpg">
</body>
</html>
DEMO