Git Product home page Git Product logo

infinitedropdown's Introduction

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

infinitedropdown's People

Contributors

lwxyfer avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.