npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

wl-scroll-bar

v1.1.6

Published

滚动条插件

Downloads

2

Readme

滚动条插件

HTML结构说明

<div style="position:relative;">
    <div id="box" style="overflow:hidden;height:200px;">
        1111111111<br>
        2222222222<br>
        3333333333<br>
        ......
    </div>
</div>

调用方式

npm install @stl/scroll-bar

css:  @import "/node_modules/@stl/scroll-bar/dist/index.css";
js:  import { scrollBar } from "@stl/scroll-bar"

let scrollBar = new scrollBar({id:"box"});

参数说明

| name | type | default | description | | :----------: | :-------: | :--------: | :------------------------------------------------------------------------------------------: | | id | string | \ | 需要滚动的元素的id**(必填)** | | direction | string | "y" | 滚动条滚动方向 默认为竖向滚动条 可选值:"y"(竖向滚动条),"x"(横向滚动条),"xy"(横向竖向都添加) | | size | number | 5 | 滚动条的尺寸(竖向滚动条为设置宽度值,横向滚动条为设置高度值) | | smallSize | number | 20 | 滚动条的最小高度/宽度(竖向滚动条为设置高度值,横向滚动条为设置宽度值),避免因内容过多导致滚动条太小 | | wheelDis | number | 40 | 每次滚动鼠标滚轮滚动的距离 | | autoRefresh | boolean | true | 是否自动监听滚动元素内容变化刷新滚动条高度 | | className | string | "" | 滚动条需要添加的类名(添加自定义样式时使用) | | xMousewheel | boolean | true | 横向滚动条是否允许滚动鼠标滚轮滚动 只有在direction值为"x"时此参数才有效 |

方法说明

方法名:      refresh
描述:        刷新滚动条的方法
调用方式:    scrollBar.refresh();

方法名:      fixedPointScroll
描述:        滚动到指定位置
调用方式:    scrollBar.fixedPointScroll(obj);
参数说明:    {left?:number,top?:number}  left:横向滚动条时使用  滚动元素需要滚动到的left值   top:竖向滚动条时使用 滚动元素需要滚动到的top值