Using jQuery Nearest Element, I would like to select elements in a circular area around a specific point. Here is the closest I can get: http://jsfiddle.net/fuYHv/. I’d also like to be able to get the inverse selection if possible. If this is not possible with the plugin and approach I’ve listed, I am open to other suggestions.
Share
What you want is proximity:
https://github.com/padolsey/jQuery-Plugins/tree/master/proximity-event
I got your fiddle working, it turns out the
max: radiusstatement doesn’t do the intuitive thing, so you have to specifically check the distance for each call on the event. But it works nicely:http://jsfiddle.net/fuYHv/12/
And for a much better and more optimized solution, see the Original Poster’s fiddle: http://jsfiddle.net/fuYHv/14/