Detect Mac touchpad overscroll

Overscroll JS

What it does: Overscroll detects when a user, using Apple's touchpad feature (Macbook Touchpad or Magic Touchpad), scrolls outside the bounds of a webpage. When they do Overscroll can fire a callback function in your application. It's extremely lightweight, has no dependencies, and is less than 400 bytes when minified.

Example:

overscroll(() => console.log('Overscroll Detected') ); Installation Via jsDeliver (Recommended)

Add the following script tag to your HTML file:

<script src="https://cdn.jsdelivr.net/npm/overscrolljs@latest/overscroll.min.js"></script> Via NPM

Navigate to your project's directory and install the Overscroll, adding it to your package.json:

$ npm i -S overscrolljs Via Yarn

Navigate to your project's directory, and execute the following command:

$ yarn add overscrolljs

Then, embed the script in your HTML using a script tag:

<script src="node_modules/overscrolljs/overscroll.min.js"></script> Contributing

Check for open issues or add your own features by starting a pull request.

Author

Eliran Pe'er - @bluzi

License

This project is licensed under the MIT License.

版权声明:

1、该文章(资料)来源于互联网公开信息,我方只是对该内容做点评,所分享的下载地址为原作者公开地址。
2、网站不提供资料下载,如需下载请到原作者页面进行下载。