Skip to content

Instantly share code, notes, and snippets.

@remy
Forked from padolsey/gist:360015
Created April 8, 2010 12:07
Show Gist options
  • Save remy/360018 to your computer and use it in GitHub Desktop.
Save remy/360018 to your computer and use it in GitHub Desktop.
Get element from mouse position
var x,y;
document.onmousemove = function(e){
e = e || window.event;
x = e.clientX;
y = e.clientY;
};
function elementAtMousePosition() {
return document.elementFromPoint(x,y);
}
@zeeshanjan82
Copy link

I have been struggling to figure out how to make elementFromPoint work. I am implementing a drag & drop using hammer.js and I would like to know when the panend event has fired which is the DOM element beneath the target

http://plnkr.co/edit/jSsELjc4XOKEk1ffq5Qh?p=preview

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment