This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes HTML, CSS and JavaScript and the fly likes ExtJs: Find mouse click coordinates relative to the sprites coordinate system. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "ExtJs: Find mouse click coordinates relative to the sprites coordinate system." Watch "ExtJs: Find mouse click coordinates relative to the sprites coordinate system." New topic
Author

ExtJs: Find mouse click coordinates relative to the sprites coordinate system.

Er. Rohit Sharma
Greenhorn

Joined: Dec 11, 2008
Posts: 16
Hi!
I need mouse click coordinates relative to the sprites coordinate system. It is SVG firefox and VML in IE. I am using Ext.EventObject getPageX() and getPageY() method to find pageX/pageY coordinates. But this is not working if I scroll the page up or down
In IE it is working but how to translate browser coordinates to VML coordinate system??
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
so subtract the scrollTop/scrollLeft values of the page position.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: ExtJs: Find mouse click coordinates relative to the sprites coordinate system.
 
Similar Threads
Coordinates of a object in javascript...
Discrepancy between getX()/getY() & graphics
mouse click event for 3D coordinates in java
Absolute div dynamically appended to body element
Coordinates and Mouse Events