in

victorqribeiro / dial, Hacker News

victorqribeiro / dial, Hacker News


                    

        

ARotary Dialfor input numbers.

RotaryDialRotaryDial

Live versionhere| Alternative linkhere

Click / Touch the disc and drag it until the arrow. When the number reaches the arrow, it will turn red, then let go and that’s your number.

Include the RotaryDial.js file.

script src="RotaryDial.js">/script>

Then create a new RotaryDial

constRD=newRotaryDial();

Creating a callback is easy, just define what your function will do with the number it receives from the RotaryDial.

constfunc=function(number) {alert(number) }constRD=newRotaryDial({callback:func});

By default the RotaryDial has the console.log function as the callback.

The RotaryDial accepts a configuration object on it’s constructor. The most import parts are the size and the callback. The size will determine the size of your rotary dial menu, and the callback determines which function will be called when a number is selected. Besides that, there are some color configurations you can fiddle with.

size– The size of the menu.Default 400 px

callback– The function that will be called when a number is selected.Default console.log

discFillColor– The disc color.

discStrokeColor– The disc border color.

circlesFillColor– The circles (where the numbers are displayed) color.

circlesStrokeColor– The circles (where the numbers are displayed) border color.

circlesHighlightColor– The color that a circle will be displayed when a number is selected.

textFillColor– The text color.

textStrokeColor– The text border color.

arrowFillColor– The arrow color.

arrowStrokeColor– The arrow border color.

  

Brave Browser
Read More
Payeer******

What do you think?

Leave a Reply

Your email address will not be published. Required fields are marked *

GIPHY App Key not set. Please check settings

IMF Forecast Triggers Fears of Global Economy at Brink of Recession, Crypto Coins News

IMF Forecast Triggers Fears of Global Economy at Brink of Recession, Crypto Coins News

MARKET LIVE: Sensex, Nifty pare gains; Reliance Cap hits 10% lower circuit – Business Standard, Business-standard.com

MARKET LIVE: Sensex, Nifty pare gains; Reliance Cap hits 10% lower circuit – Business Standard, Business-standard.com