当我使用jquery-1.11.0.min.js时,colorbox无法正确加载视频。彩色显示屏显示,但未加载YouTube视频。见OADG Dutt Roth video。当我使用jquery-1.7.1时,视频正确加载。见OADG Horse video。有人可以确定一个适用于1.11.0的解决方案吗?
<script type="text/javascript" src="../script/jquery-1.11.0.min.js"></script>
<script type="text/javascript" src="http://code.jquery.com/jquery-1.9.0.js"></script>
<script type="text/javascript" src="http://code.jquery.com/jquery-migrate-1.2.1.js"></script>
<script type="text/javascript" src="../script/jquery.colorbox-min.js" charset="utf-8"></script>
<script type="text/javascript">
/*<![CDATA[*/
jQuery(document).ready(function(){
jQuery('.youtube').colorbox({iframe: true, width: 853, height: 480, href:function(){
var videoId = new RegExp('[\\?&]v=([^&#]*)').exec(this.href);
if (videoId && videoId[1]) {
return 'http://youtube.com/embed/'+videoId[1]+'?rel=0&wmode=transparent';
}
}});
});
/*]]>*/
</script>
<div>
<p><a class='youtube' href="http://www.youtube.com/embed/Z_nAZI5dfx0?rel=0" title="Susanne Dutt-Roth Riding D2 March, 2012"><img src="S_DuttRothFeb2012.jpg" title="Susanne Dutt-Roth Riding D2 March, 2012" alt="Susanne Dutt-Roth Riding D2 March, 2012"/></a></p>
</div>
答案 0 :(得分:1)
jQuery colorbox仅与jquery 1.3+兼容。您必须在代码中引用jquery的更新版本。
&#34;兼容:jQuery 1.3.2 +&#34; http://www.jacklmoore.com/colorbox/
您的此链接(http://www.ottawadressage.ca/duttroth/)包含多个jQuery文件。请删除<head>
部分中提到的旧版本。