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

scroll-tabs-better

v1.0.0

Published

tab滚动效果, tab点击与滚动距离计算 tab 切换

Downloads

1

Readme

tab 滚动效果

滚动 tab 切换效果,tab 点击与滚动距离计算 tab 切换

demo

demo地址

html 结构说明

  • 滚动元素分为 tab 元素与 content 元素
  • tab 元素为包含 tab 标签的直接父节点元素,content 元素为包含内容元素的直接父节点元素

css 设置说明

  • tab 元素可设为不需滚动,横向滚动与纵向滚动 3 种
  • 如果需要 tab 元素随滚动自动切换位置,需设置其 position 值为非 static 值同时需要其子节点的宽度或者高度达到可滚动效果
  • content 元素若为设置其 position 值为非 static 值,且高度达到可滚动条件,则默认随 body 滚动

使用说明

  1. npm install scroll-tabs-better

  2. import ScrollTabsBetter from 'scroll-tabs-better

  3. 实例化对象说明

new ScrollTabsBetter({
  tabEle: '#tab', // tab元素
  contentEle: '#content', // tab元素
  tabDirection: 'y', // tab方向,x水平,y垂直
  initIndex: 0, // 初始index值
  changeTab: index => {
    // 切换tab的操作,通常为更新本地tab的index值
  }
})

其他

  • 兼容问题未仔细测试,可能存在部分浏览器兼容问题