Javascript错误:未捕获TypeError:undefined不是函数

时间:2015-01-07 10:01:25

标签: javascript

我正在尝试解决此问题。我无法加载此脚本http://orangeplacehotel.com/superbudget/ems-policy。这段代码有什么问题吗?我尝试了提醒,它工作正常但仍然无法看到网站上加载的插件..请帮助..谢谢,

$(function() {
    $('#nanoGallery1').nanoGallery({
        kind:'flickr',
        userID:'129251189@N05',
        touchAutoOpenDelay: -1,
        breadcrumbAutoHideTopLevel: true,
        maxWidth: 948,
        imageTransition : 'slide',
        thumbnailWidth: 200,
        thumbnailHeight: 126,
        thumbnailHoverEffect: 'scaleLabelOverImage,borderDarker',
        i18n: {
            thumbnailImageDescription: 'view photo',
            thumbnailAlbumDescription: 'open album'
        },
        thumbnailLabel: {
            display: true,
            position: 'overImageOnMiddle',
            hideIcons: true, align: 'center'
        },
        thumbnailLazyLoad: true 
    });
});
alert("test");
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>

1 个答案:

答案 0 :(得分:1)

错误是&#34; NanoGallery不是一个功能&#34; 我认为您应该在运行代码之前检查您的插件(在nanoGaller()中定义的内容)是否包含在页面中

以下代码正常运行 它不是解决方案,但可能会给你一些想法

首先包括jquery库然后

$.prototype.nanoGallery = function(){
    console.log(arguments);
}

$(function() {
    $('#nanoGallery1').nanoGallery({
        kind:'flickr',
        userID:'129251189@N05',
        touchAutoOpenDelay: -1,
        breadcrumbAutoHideTopLevel: true,
        maxWidth: 948,
        imageTransition : 'slide',
        thumbnailWidth: 200,
        thumbnailHeight: 126,
        thumbnailHoverEffect: 'scaleLabelOverImage,borderDarker',
        i18n: {
            thumbnailImageDescription: 'view photo',
            thumbnailAlbumDescription: 'open album'
        },
        thumbnailLabel: {
            display: true,
            position: 'overImageOnMiddle',
            hideIcons: true, align: 'center'
        },
        thumbnailLazyLoad: true 
    });

});

alert("test");