Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/hughsk/range-slider

A simple range slider UI element for use with browserify
https://github.com/hughsk/range-slider

Last synced: 12 days ago
JSON representation

A simple range slider UI element for use with browserify

Awesome Lists containing this project

README

        

# range-slider [![experimental](http://badges.github.io/stability-badges/dist/experimental.svg)](http://github.com/badges/stability-badges)

A simple range slider UI element for use with browserify.

[view example](http://hughsk.io/range-slider)

## Usage

[![NPM](https://nodei.co/npm/range-slider.png)](https://nodei.co/npm/range-slider/)

This module expects a "wrapper" element, and creates the slidable part on the
inside, which will take up the full size of its parent. Note that if the parent
doesn't have `position: relative|fixed|absolute` set, this will be set to
`relative` on your behalf.

### inner = range(slide, [inital], update)

Returns the slider's inside DOM element, where `slide` is a parent element that
you've already created.

`initial` is an optional value between 0 and 1 for determining where to start
the slider. `update(value)` is a function that's called every time the slider's
value changes – the value will always be a number between 0 and 1, where 0 is
the left side of the slider and 1 is the right.

## License

MIT. See [LICENSE.md](http://github.com/hughsk/range-slider/blob/master/LICENSE.md) for details.