gwt - Mouse click location on an image -


I have a GWT container with some stuff in it and an image that adds a click handler

What I try to do is to get the X and Y coordinates of the exact mouse event relative to the image. I've seen the post but this is not what I need.

As far as I can see, I have the option to get the full location and event location of the image but this only occurs when the user does not scroll down the page.

  event.getNativeEvent (). GetClientY () - image.getElement (). GetAbsoluteTop ();  

Thanks for Samuel,

Here's the solution

  event.getNativeEvent (). GetClientY () - image.getAbsoluteTop () + Document.get (). GetScrollTop ()  

Comments

Popular posts from this blog

c# - How to capture HTTP packet with SharpPcap -

php - Multiple Select with Explode: only returns the word "Array" -

php - jQuery AJAX Post not working -