Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript How to drag point (circle) and move it to sides Reply To: How to drag point (circle) and move it to sides

#186927
nixnerd
Participant

I can think of a few ways you could do this custom… even without the little slider. No ready-made utility I can think of though.

JS makes it pretty easy to track mouse position. All you have to do is get the mouse position where the left button is clicked and the position where the left button is released. Boom. You have your diameter. Or radius… whatever you prefer. All you need to do is subtract one from the other and set a div with a border radius to that size. Easy cheesey.