繁体   English   中英

无法调用未定义的方法'begin'

[英]Cannot call method 'begin' of undefined

你好,我有这个脚本在这里工作正常..知道它没有语法错误或其他。

http://jsfiddle.net/xHL35/9/

问题是我试图在这里实现它..

我试图取消设置jquery.min.js因为这是唯一的文件,我看到我的原因冲突,而不是Twitter或Facebook js,只是为了测试我只是测试它,我总是得到

无法调用未定义的方法'begin'

继承人链接,你可以检查它

http://queretaro.orsilin.com.mx/index.php?page=item/view/15/Probando

这是导致冲突的部分

if (nextImageIndex === 0) {
            scrollapi.begin(200);
        } else if ( nextImageIndex % 4 === 0 && nextImageIndex > 0) {
            scrollapi.next(200);
        }

学习调试!

这意味着scrollapi未定义。 看看它的定义。

var scrollapi = $(".scrollable").data('scrollable');
console.log($(".scrollable").length);  // Says it is Zero...sooo hence your problem
console.log($(".scrollable").data('scrollable'));  //undefined

那么问题是什么? 当此代码运行具有类.scrollable时,页面上没有元素。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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