Paolo Cruz
Paolo Cruz

Reputation: 21

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>

Upvotes: 0

Views: 1041

Answers (1)

intekhab
intekhab

Reputation: 1596

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

Upvotes: 1

Related Questions