Jump to content


 


Register a free account to unlock additional features at BleepingComputer.com
Welcome to BleepingComputer, a free community where people like yourself come together to discuss and learn how to use their computers. Using the site is easy and fun. As a guest, you can browse and view the various discussions in the forums, but can not create a new topic or reply to an existing one unless you are logged in. Other benefits of registering an account are subscribing to topics and forums, creating a blog, and having no ads shown anywhere on the site.


Click here to Register a free account now! or read our Welcome Guide to learn how to use this site.

Photo

Getting x and y coordinates of a mouse click


  • Please log in to reply
1 reply to this topic

#1 Ray Parrish

Ray Parrish

  • Members
  • 91 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Cottage Grove, Oregon
  • Local time:07:57 AM

Posted 08 April 2010 - 07:17 PM

Hello,

I am reading at the W3 schools in an attempt to find out how to return the position of a mouse click within a div element. So far I have not found the information that I need.

Suppose I have a div with the id of "drawingarea", and when I click on the drawingarea div with the mouse, I want to know the position within that div in x, and y pixels from the origin of the div at it's bottom left corner.

Can someone show me how to capture this information in an onmouseclick, or onmouseup function?

Thanks for any help you can be.

BC AdBot (Login to Remove)

 


#2 groovicus

groovicus

  • Security Colleague
  • 9,963 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Centerville, SD
  • Local time:09:57 AM

Posted 08 April 2010 - 08:00 PM

I think this site may help. Open up the site in Firebug and examine the code to figure out how it is done.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users