Sunday, 15 August 2010

javascript - Getting the coordinates of an element relative to page -


I was testing an approach for a solution and found that the methods available for a programmatically triggered Javascript program Or functions that are available when the user clicks on the element. For example, I was not able to get the mouse position of the click event. If the user clicked, I would be able to get the position of the mouse and a lot more. I am adding events and triggering it through jQuery. Is there any reason for this? Anyone know how I can get the position of the mouse after triggering it by using jQuery for programming?

you Jquery function:

  var clicked posting = $ (This) .offset (); Warning (e.clientX - clicked postation left); Warning (e.clientY - Clicked Posting.top);   

I know this is a sample on click, but you can change it ()

Here's a sample of work:



No comments:

Post a Comment