简体   繁体   中英

Javascript Error: Uncaught TypeError: undefined is not a function

I am trying to resolve the issue .I cant load this script http://orangeplacehotel.com/superbudget/ems-policy . Is there anything wrong with this code?? I tried putting alert and it works properly but still i cant see the plug-in loaded on the site.. Please help .. Thanks,

 $(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> 

error is "NanoGallery is not a function" I think you should check your plugin (in what nanoGaller() is defined) is included in page or not before running your code

Below is the code working fine Its not a solution but might give you some idea

First include the jquery library then

$.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");

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM