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

infinitedropdown

v1.0.2

Published

infinite dropdown

Downloads

9

Readme

infiniteDropdown

infinite dropdown

DOCUMENT

USAGE

Installation

USE npm: npm install --save infinitedropdown

Usage

simply include

<script src="/path/to/infinitedropdown.min.js">

or

if you use webpack or module loaders:

// CommonJS
var idd = require('infinitedropdown');

// ES2015
import idd from 'infinitedropdown';

config:

var idd = infinitedropdown({
  selector = '.am-idd', // required 默认.am-idd
  data = false, // required 指定载入的数据
  init = false, // required 数据初始位置
  showTooltip = true, // optional 是否显示指示信息
  tooltip = '请设置提示信息', // optional 替换默认的提示信息
  defaultValue = false, // optional 下拉框设定默认值
  className = '', // optional 给select增加样式名
  callback = false, // optional 设置回调函数,每次选择后触发回调函数
  })

html:

<div class="am-idd"></div>

required data structure

data structure like hash(structure is simple and clear)

const data = {
  1: {
    10: '水果',
    20: '蔬菜',
  },
  10: {
    100: '苹果',
    101: '香蕉',
  },
  20: {
    200: '土豆',
    201: '大蒜',
    202: '茄子',
  },
  100: {
    1000: '苹果一种',
    1001: '苹果两种',
  },
  101: {
    1010: '香蕉1',
    1011: '香蕉2',
  },
}

MIT LICENSE