Quick solution: getting the mouse position on an element regardless of positioning

added by DotNetKicks
4/3/2020 5:12:36 PM


Thursday, April 2nd, 2020 at 7:37 pm As I was upgrading an older codebase of mine that used layerX and layerY I looked into a very succinct way of finding the current mouse position on any element regardless of its position, scrolling, padding, margin and such and I found this to work for me, so maybe it is good for you, too.