javascript - Fullpage.js 不会在任何浏览器(chrome、firefox、edge)中滚动
问题描述
我一直在尝试使用 fullpage.js 制作一个非常简单的网站,但它不会像预期的那样滚动整个部分。我在我的代码中包含了一个片段。CSS/JS 直接从 fullpage.css 和 fullpage.js 粘贴。我在不同的浏览器上尝试过,在隐身窗口中,禁用任何扩展或插件等......它只是不会。到目前为止,我已经发现 $(window).scroll 事件不会触发,$('#fullpage').scroll 也不会触发
我的html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>test</title>
<link rel="stylesheet" type="text/css" href="fullpage.css" />
<script src="https://code.jquery.com/jquery-2.2.4.min.js" integrity="sha256-
BbhdlvQf/xTY9gja0Dq3HiwQF8LaCRTXxZKRutelT44=" crossorigin="anonymous">
</script>
<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.min.js"
integrity="sha256-VazP97ZCwtekAsvgPBSUwPFKdrwD3unUfSGVYrahUqU="
crossorigin="anonymous"></script>
<script type="text/javascript" src="fullpage.js"></script>
</head>
<body>
<div id="fullpage">
<div class="section"></div>
<div class="section"></div>
<div class="section"></div>
<div class="section"></div>
<div class="section"></div>
</div>
<script type="text/javascript">
$(document).ready(function() {
$('#fullpage').fullpage({
licenseKey: '',
autoScrolling: true,
sectionsColor: ['blue', 'yellow', 'green', 'red', 'brown']
});
$.fn.fullpage.setAllowScrolling(false);
});
</script>
</body>
</html>
解决方案
So far I've figured out the $(window).scroll event won't fire and neither will $('#fullpage').scroll
That's totally normal. Fullpage.js won't fire the scroll event.
I would encourage you to take any of the examples available as your starting point if you can't find what you are missing.
推荐阅读
- apache-kafka - Kafka Streams - flatMapValues 的 Integral 与 Separable 处理程序
- alfresco - bpm 方案中定时器事件后如果有服务任务或脚本任务出错(Alfresco 的 Activiti 6)
- c++ - 无法将数组中的负值转换为正值?
- macos - 如何在 CodeBlocks 中处理此错误?
- cloud - SAP 云平台日志文件 API
- swift - 快速构建:错误:无法构建 Objective-C 模块“达尔文”
- python - 函数、方法以及我必须给它们多少个参数?
- java - 队列不可用,但骆驼的处理器没有抛出异常
- php - mysqli_begin_transaction 正确用法
- python - 如何将 unitest textrunner 日志与日志记录相结合