jquery-nearest icon indicating copy to clipboard operation
jquery-nearest copied to clipboard

Nearest element at the distance of X pixels

Open thehappycoder opened this issue 10 years ago • 2 comments

Is it possible? I want to limit the search area to X pixels. At first I thought that tolerance is the thing but it doesn't seem to be what I am looking for.

thehappycoder avatar Dec 03 '14 17:12 thehappycoder

I presume you mean limiting based on direct distance, not just width/height calculations? Unfortunately that's not possible at the moment; I like the idea though.

For your use case, are you looking for a minimum or maximum distance, or a combination of both?

gilmoreorless avatar Dec 06 '14 08:12 gilmoreorless

The original problem I want to solve is -- the touch event's target is not accurately determined and I tweak it a bit by selecting elements that are usually supposed to be clicked on a typical form. https://github.com/cubiq/iscroll/issues/822

Then I found out about document.elementFromPoint and then jquery-nearest plugin.

thehappycoder avatar Dec 06 '14 08:12 thehappycoder