Is there a way for me to get the absolute position of a DIV element within a HTML5 Canvas element? Any help is greatly appreciated.
+1
A:
noVNC (HTML5 VNC client) has some routines that can determine:
- the actual position of a DOM element on a page: getPosition
- the offset within that DOM element where a mouse click happened: getEventPosition
They should be fairly cross-browser.
You can use those as reference and that might help with your issue: http://github.com/kanaka/noVNC/blob/master/include/util.js#L121
Disclaimer: I made noVNC.
kanaka
2010-10-21 17:10:45
+1 noVNC is awesome. Thanks for sharing your hard work. keep on rocking.
Ninja Dude
2010-10-22 12:22:54