作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我在我的网站中使用 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>
最佳答案
您没有正确包含所需的文件。确保它们位于您指定的位置。
正如文档中所指出的以及您在 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>
关于javascript - 未捕获类型错误 :undefined is not a function while using slide left infullpage. js,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26113263/
我是一名优秀的程序员,十分优秀!