2017-08-06 23 views
0

,所以我剛剛完成我的劇本與Bootstrap Youtube Modal成功,但我對使用按鈕例如<button class="yt-video" rel="some YT"><img .....=""/></button>它不工作(當我點擊測試它IAM圖片/按鈕顯示與形式上它沒有做任何事情,請一定的幫助)引導模式引導的Youtube模態的按鈕不工作與運行時錯誤檢測其IAM未能解決

測試網址: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> 
 
\t \t \t \t \t \t <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%修復它們。

回答

0

使用此代碼:

演示: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>

+0

謝謝你的代碼在演示而不是在我的網站爲我工作:https://開頭WWW。 br-gaming.ga/dev-test/?p=1.0 - 注意:我已經在Bootstrap Youtube Modal.js上編輯了第111行以滿足我的需求:它是'''return ['