You may have seen JavaScript sliders before:
http://dev.jquery.com/view/tags/ui/1.5b2/demos/ui.slider.html
What I'm envisioning is a circular slider. It would consist of a draggable button at one point on the circle -- and that button can be dragged anywhere along the ring. The value depends on what position the button is at (think of a clock).
define a center point c current mouse point at m
in your mouse drag event handler, you'd have
var dx = m.x-c.x;
var dy = m.y-c.y;
var scale = radius/Math.sqrt(dx*dx+dy*dy);
slider.x = dx*scale + c.x;
slider.y = dy*scale + c.y;
radius would be some preset value of the slider,
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With