Hey guys,
I’m writing a Firefox plugin and using the following function:
var obj = page.elementFromPoint(x,y); //x,y are the mouse coordinates
However this function returns the topmost element which lies under the given point. This isn’t good enough for me, I need the most inner element which lies under the given point. Does anyone know how to do it?
Thanks
Gecko and WebKit support the style
pointer-events: none;to prevent pointer events on the element obscuring the one you want to find, but generally you can only manually search the DOM tree. Or setdisplay: none;to the elements you don’t want to get before you useelementFromPoint, if that is possible in your setup.