New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

@redbuck/scroll

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@redbuck/scroll

scroll

latest
npmnpm
Version
1.0.0
Version published
Maintainers
1
Created
Source

@redbuck/scroll

简介

一个简单的模拟滚动插件.iScroll,better-scroll的极简实现.
支持手指滚动与鼠标滚轮事件.
支持滚动条 支持事件派发

使用

import Scroll from '@redbuck/scroll'  

new Scroll(document.getElementById('el'))

el下的子元素即可在其内部滚动(子元素的高度应超过父元素,且父元素应开启overflow: hidden);
当子元素的高度变化时,调用实例的refresh方法更新可滚动范围.

事件

通过instance.on方法监听实例派发事件,可以在合适时机实现逻辑.

Keywords

scroll

FAQs

Package last updated on 23 Feb 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts