views:

149

answers:

1

I have a GWT container with some stuff in it and an image which is added a clickhandler.

What I try to do is to get the exact mouse event's X and Y coordinates relative to the image. I saw the post here but this is not what I want.

As far as I can see, I have option like getting the image absolute location and event location but this works only if the user doesn't scroll down the page.

event.getNativeEvent().getClientY()- image.getElement().getAbsoluteTop();
A: 

Thanks to Samuel,

here is the solution

event.getNativeEvent().getClientY()- image.getAbsoluteTop() + Document.get().getScrollTop()
dkberktas