[英]Cannot call method 'begin' of undefined
你好,我有這個腳本在這里工作正常..知道它沒有語法錯誤或其他。
問題是我試圖在這里實現它..
我試圖取消設置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.