Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

position() and offset() of entities are always 0 #16

Open
DomenicJahn opened this issue Feb 7, 2020 · 1 comment
Open

position() and offset() of entities are always 0 #16

DomenicJahn opened this issue Feb 7, 2020 · 1 comment

Comments

@DomenicJahn
Copy link

DomenicJahn commented Feb 7, 2020

My HTML contains an image with an attached click-listener. I'd like to retrieve the mouse clicks position relative to the image like

var X = (e.pageX - this.offsetLeft);
var Y = (e.pageY - this.offsetTop);

but the offset always returns 0. Is there a way to get the precise relative position of an entity in the document without substracting its precalculated position?

@lorikou
Copy link

lorikou commented Jan 13, 2022

This is an issue I have also been struggling with. Any possible help/pointers would be greatly appreciated!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants