所以我刚刚成功地用自助Youtube模式完成了我的脚本,但是我用按钮示例<button class="yt-video" rel="some YT"><img .....=""/></button>测试了它,它不起作用(一旦我点击图像/按钮来显示带有模式的引导模型,它不会做任何事情,请提供一些帮助)
测试URL:https://www.br-gaming.ga/dev-test/?p=1.0#screenshots (它的第一个图像/按钮,其中包含bandicam的版权在它的头部)这里是我的代码:
$(document).ready(function(){
$(".yt-video").YouTubeModal({width: 500, height: 350})
});<script src="https://www.br-gaming.ga/dev-test/js/bootstrap.youtubemodal.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="//netdna.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<center>
<button class="yt-video" rel="jSpQCX-ezG8"><img src="https://i3.ytimg.com/vi/jSpQCX-ezG8/maxresdefault.jpg" style="width: 800px;" /></button>
</center>
我知道下面显示了一些运行时错误,但是我多次尝试用多种方法修复它们,但是iam失败了,它在这个JS项目的演示中的工作成功率是100%。
发布于 2017-08-06 20:15:00
使用以下代码:
演示: https://output.jsbin.com/sozocudobo
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>BootstrapYoutubeModal</title>
<link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="//code.jquery.com/jquery-1.12.4.min.js"></script>
<script src="//netdna.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<script src="//www.jqueryscript.net/demo/Autoplay-Youtube-Videos-In-Bootstrap-Modal-jQuery-YoutubeModal/bootstrap.youtubemodal.js"></script>
</head>
<body>
<center>
<button class="yt-video" rel="jSpQCX-ezG8"><img src="https://i3.ytimg.com/vi/jSpQCX-ezG8/maxresdefault.jpg" style="width: 800px;" /></button>
</center>
<script>
$(document).ready(function(){
$(".yt-video").YouTubeModal({width: 500, height: 350})
});
</script>
</body>
</html>
https://stackoverflow.com/questions/45536075
复制相似问题