Find element at (x,y) coordinate in Javascript (highest visible element) -
Find element at (x,y) coordinate in Javascript (highest visible element) -
i'm writing html debugger pure javascript , i'm come roadblock while trying emulate mouse pointer. thought move mouse on "admin" page , alter reflected on client machine running debug javascript code. want "click" on admin page , target client dom element simulated cursor on client machine under css/remove operations. can calculate element under image using z-index, dom order, etc puts huge load on client , point maintain application lite possible. plus, browser doing calculations mouse , waste rewrite entire algorithm myself(if have time , patience).
is there javascript function or there browser specific api's can utilize determine element straight under another?
document.elementfrompoint should work you. if want elements @ (x, y) coordinate, there number of implementations of elementsfrompoint
, e.g. https://gist.github.com/oslego/7265412.
javascript
Comments
Post a Comment