[英]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 . 我正在尝试解决此问题。我无法加载此脚本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 错误是“ NanoGallery不是函数”,我认为您应该在运行代码之前检查页面中是否包含插件(定义了nanoGaller())。
Below is the code working fine Its not a solution but might give you some idea 下面是可以正常工作的代码,它不是解决方案,但可能会给您一些帮助
First include the jquery library then 首先包括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");
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.