seiyria / bootstrap-slider

A slider control for Bootstrap 3 & 4.
http://seiyria.github.io/bootstrap-slider/
Other
2.99k stars 1.14k forks source link

Centered slider with negative and positive end points #754

Closed absessive closed 7 years ago

absessive commented 7 years ago

How do I configure a slider with index (0) at the center and end points both positive and negative with the selection being colored on either end from the center (0)?

Issues

NOTE: Before filing a new issue, please search through the open issues list and check to see if an existing issue already exists that describes your problem. If so, leave a comment within that issue with the checklist items described below.

Please make sure you include the following in your issue report where appropriate:

seiyria commented 7 years ago

Use the formatter function. If you have values -4 to 4, set the min to 0, max to 8, and when transforming the value subtract 4.

absessive commented 7 years ago

@seiyria does that also allow setting the color for either side of the 0 -4 to 0 -> Red and 0 to 4 -> Green

seiyria commented 7 years ago

yes, you can set the range highlights however you want.