0

I'm trying to find where a given menu item (which is within a drop down vertical menu) is located on the screen but getAbsoluteTop() getAbsoluteLeft() are zero even when the menu item is showing on the screen

The actual Element by the way seems to be

Any idea how I can find where a menu item (within a floating drop down menu) is on the screen please?

Thanks!

user1176505
  • 729
  • 5
  • 16

1 Answers1

0

Most likely, you ask for the coordinates before the menu item is fully rendered. Try using a Scheduler (GWT: Timer and Scheduler Classes) to wait until the menu item is fully rendered and then ask for the coordinates inside the execute method.

Community
  • 1
  • 1
Andrei Volgin
  • 40,755
  • 6
  • 49
  • 58