# newScroll **Repository Path**: nftstudio/newscroll ## Basic Information - **Project Name**: newScroll - **Description**: 全屏滚动js - **Primary Language**: Unknown - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2024-03-15 - **Last Updated**: 2024-03-15 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README 用原生 javascript 实现的全屏滚动,不需要任何框架或库支持。 缺陷: 1.需要设置body的overflow:hidden; 才能滚动……原因不明,欢迎讨论 2.不支持横向滚动,这个没写…… 3.不支持锚点,这个没写…… 4.全屏容器的高度超过视窗高度,还是滚动整屏……这个不合理,但是没有思路,欢迎讨论。 用法: 引入 newscroll.js html结构 // 结构一 body 容器 全屏容器 全屏容器 全屏容器 全屏容器 全屏容器 *n // 结构二 body 全屏容器 全屏容器 全屏容器 全屏容器 全屏容器 *n const newScrollInstance = new newScroll({ setSections: '.section1', // 全屏容器 的 class // scrollbarSet: false, // 是否隐藏滚动条 默认 'none' // sectionActive: 'active1', // 当前激活的section // scrollBefore: () => { // 滚动前执行 // console.log('我是新定义的scroll前'); // }, // scrollAfter: () => { // 滚动后执行 // console.log('我是新定义的scroll后'); // }, // debug: true, // 显示设置 });