fancybox undefined不是一个函数

时间:2014-12-10 08:23:43

标签: javascript jquery fancybox fancybox-2

我有以下脚本包括页面部分:

<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<script src="<c:url value ='/resources/js/jquery-1.8.2.min.js'/>"></script>
<script type="text/javascript"
        src="<c:url value='/resources/js/underscore.js'/>"></script>
<!-- the mousewheel plugin -->
<script type="text/javascript" src="<c:url value ='/resources/js/jquery.mousewheel.js'/>"></script>
<!-- the jScrollPane script -->
<script type="text/javascript" src="<c:url value ='/resources/js/popup.js'/>"></script>
<script type="text/javascript" src="<c:url value ='/resources/js/jquery.jscrollpane.min.js'/>"></script>
<script type="text/javascript" src="<c:url value ='/resources/js/scroll-startstop.events.jquery.js'/>"></script>
<script src="<c:url value ='/resources/js/jquery.ikSelect.js'/>" type="text/javascript"></script>
<script type="text/javascript" src="<c:url value ='/resources/js/jquery-ui-1.10.0.custom.min.js'/>"></script>
<!--uniform-->
<script src="<c:url value ='/resources/js/jquery.uniform.js'/>" type="text/javascript"></script>
<script type="text/javascript" charset="utf-8">

</script>
<!--end uniform-->




<script type="text/javascript" src="<c:url value ='/resources/js/script-ini.js'/>"></script>
<script type="text/javascript" src="<c:url value ='/resources/js/addImage.js'/>"></script>
<!-- Add fancyBox main JS and CSS files -->
<script type="text/javascript" src="<c:url value ='/resources/js/source/jquery.fancybox.js?v=2.1.5'/>"></script>
<link rel="stylesheet" type="text/css" href="<c:url value ='/resources/js/source/jquery.fancybox.css?v=2.1.5'/>" media="screen" />

<!-- Add Button helper (this is optional) -->
<link rel="stylesheet" type="text/css" href="<c:url value ='/resources/js/source/helpers/jquery.fancybox-buttons.css?v=1.0.5'/>" />
<script type="text/javascript" src="<c:url value ='/resources/js/source/helpers/jquery.fancybox-buttons.js?v=1.0.5'/>"></script>

<!-- Add Thumbnail helper (this is optional) -->
<link rel="stylesheet" type="text/css" href="<c:url value ='/resources/js/source/helpers/jquery.fancybox-thumbs.css?v=1.0.7'/>" />
<script type="text/javascript" src="<c:url value ='/resources/js/source/helpers/jquery.fancybox-thumbs.js?v=1.0.7'/>"></script>

<!-- Add Media helper (this is optional) -->
<script type="text/javascript" src="<c:url value ='/resources/js/source/helpers/jquery.fancybox-media.js?v=1.0.6'/>"></script>

跟随js:

$(".image").fancybox({
    helpers: {
        title : {
            type : 'float'
        }
    }
});

并跟随html:

<a href="/member/createCompany/getOriginalImage/1" title="" class="image">
     <img src="/member/createCompany/getSmallThumbnail/1" alt="">
</a>

当我加载页面时,我看到以下行的错误undefined is not a function

 $(".image").fancybox({

如何解决?

更新

当我改写这样的时候:

$(document).ready(function () {
    $(".image").fancybox({
        helpers: {
            title : {
                type : 'float'
            }
        }
    });
}
来自控制台的

错误消失但是当我点击图片时会打开带有图片的新标签。我想看看fancybox

0 个答案:

没有答案