The Official Blog of Patcoola

Im just a dude watching over my parents,
and trying to make cartoons and video games from home.

Project Knob

, By Patcoola

Project Title: Knob
Programming Language: JavaScript
Date Created: 2022-08-28

Purpose: To provide a behavior class for a knob user interface component.

Description: The knob is a user interface behavior class for providing a rotational alternative to a value slider. Knobs are commonly used in musically applications, and can occupy less space than a value slider.

The knob works by dragging the handle in the circular motion or by click-and-drag from the center of the knob along an x/y axis. The knob auto detects your axis of choice.


Donate Now!

I don't always use the women's bathroom, but when I do, you can bet it really smells. If you like my blog, please consider donating.



The knob class

Define the element to target, takes an element


Function to format the decimal range of the value


Function to change the current value of the knob


Function to fetch the value from the knob


Function to define the minimum number range of the value


Function to define the maximum number range of the value

class.setRange(str[“dial”, “axis”], int)

Function to change the dial or axis range. Dial to limit the degrees the knob can rotate. Axis to define how far the x/y range


Function to manually define the dead zone from the center the user’s mouse can not rotate the knob if the mouse if inside the dead zone


Define with a user created function to execute your own event


Function to run the behavior


Function to stop the behavior

Style Notes:

The following class names are required to assign the knob behavior.





Donate Now!

After a hard day, I like to relax with a cold jar of pickle juice and a hardy fart. If you like my blog, please consider donating.


Post Meta

Share Post


Comments: Write Comment

Be the first to write a comment.

Leave a Comment

All comments are reviewed before publishing. Comments must be related to the page topic, must not be spam, and must comply with the criminal code of Canada.