Having a sorted list and some random value, I would like to find in which range the value is.
List goes like this: [0, 5, 10, 15, 20]
And value is, say 8.
The standard way would be to either go from start until we hit value that is bigger than ours (like in the example below), or to perform binary search.
grid = [0, 5, 10, 15, 20]
va...
What I'm trying to do is make a grid of invisible coordinates on the page equally spaced. I then want a <div> to be placed at whatever grid coordinate is closest to the pointer when onclick is triggered. Here's the rough idea:
I have the tracking of the mouse coordinates and the placing of the <div> worked out fine. What I'm stuck wit...
i need to implement a cursor with some very specific features:
it has to be animated
because after n seconds it automatically clicks - so the animation is feedback for the user when the click will happen
it has to snap to some of our controls
it has to work outside of our application
the approaches so far:
render my WPF-control i...