上下文:我使用了很多自定义JS的主题,它们都在工作,直到我开始添加自己的JavaScript,点我开始收到此错误:jQuery(...)。addClass(...)。viewportChecker不是一个函数
theme.js:28 Uncaught TypeError: jQuery(...).addClass(...).viewportChecker is not a function
它的示数就行如下:
jQuery('.scroll1').addClass("hidden").viewportChecker({
classToAdd: 'visible animated fadeIn', // Class to add to the elements when they are visible
}); ;
起初我以为的jQuery正在更新自己的音乐库,但因为这个问题是今天早上还在坚持。 ..我不相信是这样。
链接,援助http://yardlad.webbtechgroup.us
它看起来像'viewportChecker'是一个jQuery插件。你确定你正在引用它的脚本文件吗?另外,如果没有小提琴,或者至少有足够的代码来重现问题,我们可以做的不多,以帮助您。 –
我认为这个问题与viewPortChecker函数的范围有关。很有可能它不是由add类返回的对象的一部分。 –
@RichardBarker - 是的。它是一个jQuery插件,它们(通常)是可链接的 – Jamiec