Skip to content
Find the elements in a page that are closest to a particular point or element, based on pixel dimensions
JavaScript HTML CSS Makefile
Branch: master
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
demo Updated URL paths for common docs files Oct 19, 2015
inc Cleanup: Removed old, unused CSS file Oct 19, 2015
src Bumped version to 1.4.0 Nov 10, 2015
test
CONTRIBUTING.md Basic contribution guide (closes #15) Feb 1, 2014
LICENSE.txt Fixed licence formatting Apr 26, 2015
Makefile Build script tweaks Apr 26, 2015
README.md Added jQuery plugin manifest Jul 13, 2013
VERSION.txt Bumped version to 1.4.0 Nov 10, 2015
bower.json Bumped version to 1.4.0 Nov 10, 2015
index.html Bumped version to 1.4.0 Nov 10, 2015
package.json Bumped version to 1.4.0 Nov 10, 2015

README.md

jQuery Nearest Element plugin

Full documentation is at http://gilmoreorless.github.io/jquery-nearest/

Demo: http://gilmoreorless.github.io/jquery-nearest/demo.html

Method signatures:

  • $.nearest({x, y}, selector) - find $(selector) closest to x/y point on screen
  • $(elem).nearest(selector) - find $(selector) closest to elem
  • $(elemSet).nearest({x, y}) - filter $(elemSet) and return closest to x/y point on screen

Reverse logic:

  • $.furthest()
  • $(elem).furthest()

Intersecting/touching:

  • $.touching()
  • $(elem).touching()
You can’t perform that action at this time.