Skip to content

Commit

Permalink
Filled in readme
Browse files Browse the repository at this point in the history
  • Loading branch information
tyleryasaka committed Jan 10, 2016
1 parent 69ffd0d commit a332f9b
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,29 @@
# semantic-ui-range
Add-on range slider for Semantic UI

[Demo](http://codepen.io/tyleryasaka/pen/KVqPbo)

I created the range slider for Semantic UI when I found that one currently did not exist.

The range slider is responsive and works for both mouse and touchscreen on all the devices it has been tested on. It uses standard css/javascript (no hacks) so it should render well on just about any remotely modern device. That said I have not thoroughly tested it, so let me know if you encounter any bugs.

To use these ranges, just add the range.js and range.css files in this repo to your project. To create a range instance, you'll need to do 2 things. First, the HTML:

<div class="ui range" id="my-range"></div>

Then you'll need to instantiate it with jQuery:

$('#my-range').range({
min: 0,
max: 10,
start: 5
});

And that's it. Notice the settings object you pass into the jQuery function. There are 5 settings you can pass in:
* min - the lowest value (inclusive) of the range
* max - the highest value (inclusive) of the range
* start (optional) - the initial value of the range (must be between min and max)
* input (optional) - A jQuery identifier string (such as '#my-input') to specify an html input to receive the new range value each time it is changed
* onChange (optional) - function to call each time the value of the range changes; a single parameter with the new value is passed to this function

So you can specify an html input or use your own custom function to receive the range value. Check out the [demo](http://codepen.io/tyleryasaka/pen/KVqPbo) for examples.

0 comments on commit a332f9b

Please sign in to comment.