<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>Page Scroll Effect</title> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/fullPage.js/3.1.2/fullpage.min.css"> <style> /* 自定义样式 */ .section { text-align: center; padding: 50px; color: #fff; } #menu { position: fixed; top: 20px; right: 20px; z-index: 9999; } #menu li { display: inline-block; margin: 0 10px; cursor: pointer; color: #fff; } </style> </head> <body> <div id="fullpage"> <div class="section" data-anchor="section1" style="background-color: #f2f2f2;"> <h1>Section 1</h1> </div> <div class="section" data-anchor="section2" style="background-color: #4BBFC3;"> <h1>Section 2</h1> </div> <div class="section" data-anchor="section3" style="background-color: #7BAABE;"> <h1>Section 3</h1> </div> </div> <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/fullPage.js/3.1.2/fullpage.min.js"></script> <script> $(document).ready(function() { $('#fullpage').fullpage({ sectionsColor: ['#f2f2f2', '#4BBFC3', '#7BAABE'], scrollingSpeed: 1000, menu: '#menu', afterLoad: function(origin, destination, direction) { // 滚动到某个部分后的操作 } }); }); </script> </body> </html>