phpknight Posted August 3, 2009 Share Posted August 3, 2009 I'm having trouble figuring this one out because the mouse coodinates don't match in different browsers. Firefox seems to be giving me a number from the start of the client window, but IE gives me numbers from the start of the containing object. In short, what I am looking to do is have an art canvas somewhere inside a website. When a user clicks on the top left corner, I want all browsers to give me 0, 0. Let's say the canvas is 500x500. When the user clicks the center, it should return 250, 250. I'd like this to work similarily on all browsers. However, when looking at the DOM inspector in Firefox, I can't see a way to do it. Also, if anybody knows of a good, free DOM inspector for IE, please let me know. Link to comment https://forums.phpfreaks.com/topic/168567-getting-mouse-coordinates-within-a-canvas/ Share on other sites More sharing options...
haku Posted August 3, 2009 Share Posted August 3, 2009 The problem is on line 36 of your code. Link to comment https://forums.phpfreaks.com/topic/168567-getting-mouse-coordinates-within-a-canvas/#findComment-889543 Share on other sites More sharing options...
phpknight Posted August 3, 2009 Author Share Posted August 3, 2009 Please explain. Link to comment https://forums.phpfreaks.com/topic/168567-getting-mouse-coordinates-within-a-canvas/#findComment-889786 Share on other sites More sharing options...
mikesta707 Posted August 3, 2009 Share Posted August 3, 2009 I believe he wants you to post your code. I laughed a little on the inside Link to comment https://forums.phpfreaks.com/topic/168567-getting-mouse-coordinates-within-a-canvas/#findComment-890016 Share on other sites More sharing options...
haku Posted August 3, 2009 Share Posted August 3, 2009 Five points to Mikesta Link to comment https://forums.phpfreaks.com/topic/168567-getting-mouse-coordinates-within-a-canvas/#findComment-890165 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.