我已按照此处的说明操作:fancybox 2.0.4 and Vimeo尝试将视频作为灯箱打开,但我仍然无法使用精美的盒子。有什么想法吗?
带有视频的页面:http://kodiakgroup.com/clients.php
HTML:
<div class="lightbox-client" style="margin-right: 20px;">
<a href="http://player.vimeo.com/video/65867546?title=0&byline=0&portrait=0" class="lightbox"><img src="/images/thumb-video-carlton.jpg" /><br /><br />Carlton-Bates</a>
</div>
<div class="lightbox-client">
<a href="http://player.vimeo.com/video/65867545?title=0&byline=0&portrait=0" class="lightbox"><img src="/images/thumb-video-arris.jpg" /><br /><br />Arris</a>
</div>
靠近底部的Javascript:
<!--script for lightbox-->
<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js"></script>
<script type="text/javascript" src="/js/fancybox/jquery.mousewheel-3.0.4.pack.js"></script>
<script type="text/javascript" src="/js/fancybox/jquery.fancybox-1.3.4.pack.js"></script>
<link rel="stylesheet" type="text/css" href="/js/fancybox/jquery.fancybox-1.3.4.css" media="screen" />
<script type="text/javascript">
$(document).ready(function() {
$(".lightbox").fancybox({
width: 400,
height: 225,
type: 'iframe',
fitToView : false
});
});
</script>
错误:
Uncaught TypeError: Cannot read property 'msie' of undefined jquery.fancybox-1.3.4.pack.js:18
Uncaught TypeError: Object [object Object] has no method 'fancybox'
答案 0 :(得分:0)
错误是:Uncaught TypeError: Object [object Object] has no method 'fancybox'
删除1个jQuery实例(您要加载它两次)并按以下顺序加载脚本:
//ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js
/js/fancybox/jquery.fancybox-1.3.4.pack.js
/js/fancybox/jquery.mousewheel-3.0.4.pack.js
(删除//ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js
的第二个实例)