Does anybody know how I can find the closest element that is for example at point (100,100) on a web page in Prototype?
I want to when scrolling down the page, locate the closest item that is currently showing and pass it is variable via the window.hash, so that when reloading the page, the page is showing exactly where you have left it.
Any ideas?
Technically, the closest element would be
bodyorhtml, since those are pervasisely “under” everything else. Beyond that, your only real option would be to calculate distances to every other object and pick the shortest one.