@maslick/radiaslider
Advanced tools
Comparing version 1.1.0 to 1.1.1
{ | ||
"name": "@maslick/radiaslider", | ||
"version": "1.1.0", | ||
"version": "1.1.1", | ||
"description": "nice looking canvas-based radial and linear slider", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -9,8 +9,9 @@ # =radiaSlider= | ||
## Features | ||
``` | ||
* works on desktop, mobile and tablets | ||
* minified ~6 Kb | ||
* small size (minified ~6 Kb) | ||
* no dependencies | ||
* pure JavaScript (ECMAScript 5.1) | ||
* no dependencies | ||
``` | ||
@@ -30,3 +31,3 @@ | ||
- create a canvas and the value field | ||
``` | ||
```html | ||
<canvas id="myCanvas" width="300" height="300"></canvas> | ||
@@ -38,3 +39,3 @@ <span id="value1"></span> | ||
- import js | ||
```js | ||
```html | ||
<script src="slider-circular.min.js"></script> | ||
@@ -45,3 +46,3 @@ ``` | ||
<script> | ||
var slider = new Slider({canvasId: "myCanvas", continuousMode: true, x0: 150, y0: 150}); | ||
var slider = new Slider({ canvasId: "myCanvas", continuousMode: true, x0: 150, y0: 150 }); | ||
slider.addSlider({ | ||
@@ -64,3 +65,3 @@ id: 1, | ||
- import js | ||
``` | ||
```html | ||
<script src="slider-linear.min.js"></script> | ||
@@ -71,3 +72,3 @@ ``` | ||
<script> | ||
var slider = new Slider({canvasId: "myCanvas", continuousMode: true, vertical: false}); | ||
var slider = new Slider({ canvasId: "myCanvas", continuousMode: true, vertical: false }); | ||
slider.addSlider({ | ||
@@ -89,3 +90,5 @@ id: 1, | ||
- if you want to change the value programmatically, use: | ||
## Get/set value programmatically | ||
If you want to change the value programmatically, use: | ||
```js | ||
@@ -95,4 +98,12 @@ slider.setSliderValue(<sliderId>, <value>); | ||
To get the current value: | ||
```js | ||
slider.sliders[<sliderId>].normalizedValue // current value | ||
slider.sliders[<sliderId>].ang_degrees // current angle in degrees (circular only) | ||
slider.sliders[<sliderId>].endAngle // current angle in radians (circular only) | ||
slider.sliders[<sliderId>].value // current width in pixels (linear only) | ||
``` | ||
## License | ||
This project is licenced under the [MIT License](http://opensource.org/licenses/mit-license.html). |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
121511
102