Search the web
Sign In
New User? Sign Up
canvas-developers · Canvas Developers
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Real people. Real stories. See how Yahoo! Groups impacts members worldwide.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
Getting mouse X/Y   Message List  
Reply | Forward Message #470 of 493 |
Hi,

I'm having severe trouble getting the mouse coords when a canvas is
colicked on AND it's nested within a table. I've setup an example to
illustrate the issue here:

http://dev.rgraph.org/

The top graph is within a table, and when you click on it, it shows
you the position of the mouse pointer (which seems fine), and the
offsetLeft of the canvas, which is coming up as 1. Clearly it
shouldn't be. I need the position of the canvas on the page, or the
position of the mouse relative to the canvas. The bottom graph is not
in a table, using a DIV for positioning, and this is fine.

Thanks for any help.

--
Richard Heyes

HTML5 Graphing for FF, Chrome, Opera and Safari:
http://www.rgraph.org (Updated December 5th)



Mon Dec 15, 2008 11:00 am

richard.heyes@...
Send Email Send Email

Forward
Message #470 of 493 |
Expand Messages Author Sort by Date

Hi, I'm having severe trouble getting the mouse coords when a canvas is colicked on AND it's nested within a table. I've setup an example to illustrate the...
Richard Heyes
richard.heyes@...
Send Email
Dec 15, 2008
11:00 am

The Offset* APIs are based on the location relative to the parent element. You'll need to compute the offset by walking the DOM using "offsetParent". (Don't...
Jerason Banes
thewiirocks
Offline Send Email
Dec 15, 2008
1:55 pm

... Hi, That's what I was afraid of. Still, I've manged to do it (!): http://dev.rgraph.org/ Thank you! -- Richard Heyes HTML5 Graphing for FF, Chrome, Opera...
Richard Heyes
richard.heyes@...
Send Email
Dec 15, 2008
4:16 pm

Happy to be of service. :-) Thanks, Jerason...
Jerason Banes
thewiirocks
Offline Send Email
Dec 15, 2008
4:37 pm

... Hi, Seems I spoke too soon. Sorry for the noise. -- Richard Heyes HTML5 Graphing for FF, Chrome, Opera and Safari: http://www.rgraph.org (Updated December...
Richard Heyes
richard.heyes@...
Send Email
Dec 15, 2008
5:11 pm

... For anyone that's interested I've now managed to get it working: http://dev.rgraph.org I used [event].offsetX/Y for Safari, Opera, MSIE and Chrome, and for...
Richard Heyes
richard.heyes@...
Send Email
Dec 29, 2008
5:38 pm
Advanced

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help