首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Javascript错误:未捕获TypeError:未定义不是函数

Javascript错误:未捕获TypeError:未定义不是函数
EN

Stack Overflow用户
提问于 2015-01-07 18:01:25
回答 1查看 1K关注 0票数 0

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

代码语言:javascript
复制
$(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");
代码语言:javascript
复制
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>

EN

回答 1

Stack Overflow用户

发布于 2015-01-07 19:09:11

错误是"NanoGallery不是一个函数“我认为你应该在运行你的代码之前检查你的插件( nanoGaller()的定义)是否包含在页面中

下面是运行良好的代码,这不是一个解决方案,但可能会给你一些想法

首先包含jquery库,然后

代码语言:javascript
复制
$.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");
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/27816824

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档