未使用的typeError:在使用幻灯片放入infullpage.js时,undefined不是一个函数

时间:2014-09-30 05:18:29

标签: javascript jquery fullpage.js

我在我的网站上使用fullpage.js。我希望水平幻灯片自动滑动。为此,我使用以下代码。但是我在控制台中遇到错误:

Uncaught typeError:undefined is not a function.

代码:

<script type="text/javascript">
    $(document).ready(function() {
        $('#fullpage').fullpage({
            anchors: ['home', 'about', 'why-us','services','team','contact'],
            autoScrolling: true,
            css3: true,
            afterRender: function () {
                setInterval(function () {
                    $.fn.fullpage.moveSlideRight();
                }, 3000);
            }
        });
    });
</script>

1 个答案:

答案 0 :(得分:1)

您未正确包含所需文件。 确保它们位于您指定的位置。

正如文档中所指出的那样,正如您在the examples provided中所看到的,这是添加所需文件时必须遵循的结构。

<link rel="stylesheet" type="text/css" href="jquery.fullPage.css" />

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>

<!-- This following line is needed in case of using the default easing option or when using another
 one rather than "linear" or "swing". You can also add the full jQuery UI instead of this file if you prefer -->
<script src="vendors/jquery.easings.min.js"></script>


<!-- This following line needed in the case of using the plugin option `scrollOverflow:true` -->
<script type="text/javascript" src="vendors/jquery.slimscroll.min.js"></script>

<script type="text/javascript" src="jquery.fullPage.js"></script>